summary refs log tree commit diff
path: root/nixos/modules/services/hardware/udev.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-25 00:27:06 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-25 00:40:34 +0200
commit9c61317002edf32812d793aebac86a990edcd1cb (patch)
tree0fcf366014270704b5705b54c4ee01445c78ce3c /nixos/modules/services/hardware/udev.nix
parentce6daa507a4e110aa33447f70bd4764df9ea10c8 (diff)
downloadnixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar.gz
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar.bz2
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar.lz
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar.xz
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.tar.zst
nixpkgs-9c61317002edf32812d793aebac86a990edcd1cb.zip
Put all firmware in $out/lib/firmware
This way, hardware.firmware can be a list of packages.
Diffstat (limited to 'nixos/modules/services/hardware/udev.nix')
-rw-r--r--nixos/modules/services/hardware/udev.nix22
1 files changed, 10 insertions, 12 deletions
diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix
index fc89de777e8..513eb27b406 100644
--- a/nixos/modules/services/hardware/udev.nix
+++ b/nixos/modules/services/hardware/udev.nix
@@ -171,25 +171,23 @@ in
     };
 
     hardware.firmware = mkOption {
-      type = types.listOf types.path;
+      type = types.listOf types.package;
       default = [];
       description = ''
-        List of directories containing firmware files.  Such files
+        List of packages containing firmware files.  Such files
         will be loaded automatically if the kernel asks for them
         (i.e., when it has detected specific hardware that requires
-        firmware to function).  If more than one path contains a
-        firmware file with the same name, the first path in the list
-        takes precedence.  Note that you must rebuild your system if
-        you add files to any of these directories.  For quick testing,
+        firmware to function).  If multiple packages contain firmware
+        files with the same name, the first package in the list takes
+        precedence.  Note that you must rebuild your system if you add
+        files to any of these directories.  For quick testing,
         put firmware files in <filename>/root/test-firmware</filename>
-        and add that directory to the list.  Note that you can also
-        add firmware packages to this list as these are directories in
-        the nix store.
+        and add that directory to the list.
       '';
       apply = list: pkgs.buildEnv {
         name = "firmware";
         paths = list;
-        pathsToLink = [ "/" ];
+        pathsToLink = [ "/lib/firmware" ];
         ignoreCollisions = true;
       };
     };
@@ -236,7 +234,7 @@ in
       (isYes "NET")
     ];
 
-    boot.extraModprobeConfig = "options firmware_class path=${config.hardware.firmware}";
+    boot.extraModprobeConfig = "options firmware_class path=${config.hardware.firmware}/lib/firmware";
 
     system.activationScripts.udevd =
       ''
@@ -254,7 +252,7 @@ in
 
         # Allow the kernel to find our firmware.
         if [ -e /sys/module/firmware_class/parameters/path ]; then
-          echo -n "${config.hardware.firmware}" > /sys/module/firmware_class/parameters/path
+          echo -n "${config.hardware.firmware}/lib/firmware" > /sys/module/firmware_class/parameters/path
         fi
       '';