From e57a10dbddc4e1a27e2cb572dd6d80573e96747d Mon Sep 17 00:00:00 2001 From: Michael Eden Date: Fri, 26 Apr 2019 15:38:58 -0400 Subject: [PATCH] ap-puns: only add the firmware we need to the image to save on space --- images/ap-puns/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/images/ap-puns/default.nix b/images/ap-puns/default.nix index ab2c7c8..d056964 100644 --- a/images/ap-puns/default.nix +++ b/images/ap-puns/default.nix @@ -1,10 +1,17 @@ -{ ... }: +{ pkgs, ... }: { imports = [ ../mini ./service.nix ]; + # + # NOTE: this is built to work with the ralink 2870 chipset. + # https://www.amazon.com/150Mbps-Adapter-LOTEKOO-Wireless-Raspberry/dp/B06Y2HKT75 + # to use your own WiFi dongle, add its kernel modules and firmware + # + + # add the WiFi kernel modules boot.kernelPatches = [ { name = "ralink-chipset"; @@ -24,4 +31,12 @@ ''; } ]; + + # add the WiFi firmware + hardware.firmware = [ + (pkgs.runCommand "rt2870" {} '' + mkdir -p $out/lib/firmware + cp ${pkgs.firmwareLinuxNonfree}/lib/firmware/rt2870.bin $out/lib/firmware/ + '') + ]; }