3
0
Fork 0
forked from mirrors/nixpkgs

nixos: Add boot.initrd.extraUdevRulesCommands

This commit is contained in:
Luca Bruno 2014-11-10 22:08:10 +01:00
parent 83cecbdcbc
commit 31df4f70af
2 changed files with 16 additions and 1 deletions

View file

@ -127,8 +127,8 @@ let
cp -v ${udev}/lib/udev/rules.d/60-persistent-storage.rules $out/
cp -v ${udev}/lib/udev/rules.d/80-drivers.rules $out/
cp -v ${pkgs.lvm2}/lib/udev/rules.d/*.rules $out/
cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
cp -v ${pkgs.bcache-tools}/lib/udev/rules.d/*.rules $out/
${config.boot.initrd.extraUdevRulesCommands}
for i in $out/*.rules; do
substituteInPlace $i \
@ -302,6 +302,17 @@ in
'';
};
boot.initrd.extraUdevRulesCommands = mkOption {
internal = true;
default = "";
type = types.lines;
description = ''
Shell commands to be executed in the builder of the
udev-rules derivation. This can be used to add
additional udev rules in the initial ramdisk.
'';
};
boot.initrd.compressor = mkOption {
internal = true;
default = "gzip -9";

View file

@ -8,4 +8,8 @@
boot.initrd.availableKernelModules = [ "md_mod" "raid0" "raid1" "raid456" ];
boot.initrd.extraUdevRulesCommands = ''
cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/
'';
}