git.iko.soy/typeable/nixpkgs
on master help sign in
nixos: Add boot.initrd.extraUdevRulesCommands
commit31df4f70afbe0ca3e5fa1f52f4a9c4c28f23c61a authorLuca Bruno <lethalman88@gmail.com> dateMon 10 Nov 2014, 22:08 (12 years ago) parent83cecbd
2 files changed+16−1
nixos/modules/system/boot/stage-1.nix+12−1 nixos/modules/tasks/swraid.nix+4
nixos/modules/system/boot/stage-1.nix+12−1
@@ -127,8 +127,8 @@ let
127127 cp -v ${udev}/lib/udev/rules.d/60-persistent-storage.rules $out/
128128 cp -v ${udev}/lib/udev/rules.d/80-drivers.rules $out/
129129 cp -v ${pkgs.lvm2}/lib/udev/rules.d/*.rules $out/
130− cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
131130 cp -v ${pkgs.bcache-tools}/lib/udev/rules.d/*.rules $out/
131+ ${config.boot.initrd.extraUdevRulesCommands}
132132
133133 for i in $out/*.rules; do
134134 substituteInPlace $i \
@@ -302,6 +302,17 @@ in
302302 '';
303303 };
304304
305+ boot.initrd.extraUdevRulesCommands = mkOption {
306+ internal = true;
307+ default = "";
308+ type = types.lines;
309+ description = ''
310+ Shell commands to be executed in the builder of the
311+ udev-rules derivation. This can be used to add
312+ additional udev rules in the initial ramdisk.
313+ '';
314+ };
315+
305316 boot.initrd.compressor = mkOption {
306317 internal = true;
307318 default = "gzip -9";
nixos/modules/tasks/swraid.nix+4
@@ -8,4 +8,8 @@
88
99 boot.initrd.availableKernelModules = [ "md_mod" "raid0" "raid1" "raid456" ];
1010
11+ boot.initrd.extraUdevRulesCommands = ''
12+ cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
13+ '';
14+
1115}