diff options
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 5 | ||||
-rw-r--r-- | nixos/modules/tasks/swraid.nix | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 81e5e974b9c23..eec3461de7e77 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -133,10 +133,6 @@ let copy_bin_and_libs ${getBin pkgs.lvm2}/bin/dmsetup copy_bin_and_libs ${getBin pkgs.lvm2}/bin/lvm - # Add RAID mdadm tool. - copy_bin_and_libs ${pkgs.mdadm}/sbin/mdadm - copy_bin_and_libs ${pkgs.mdadm}/sbin/mdmon - # Copy udev. copy_bin_and_libs ${udev}/bin/udevadm copy_bin_and_libs ${udev}/lib/systemd/systemd-sysctl @@ -225,7 +221,6 @@ let $out/bin/udevadm --version $out/bin/dmsetup --version 2>&1 | tee -a log | grep -q "version:" LVM_SYSTEM_DIR=$out $out/bin/lvm version 2>&1 | tee -a log | grep -q "LVM" - $out/bin/mdadm --version ${optionalString config.services.multipath.enable '' ($out/bin/multipath || true) 2>&1 | grep -q 'need to be root' ($out/bin/multipathd || true) 2>&1 | grep -q 'need to be root' diff --git a/nixos/modules/tasks/swraid.nix b/nixos/modules/tasks/swraid.nix index d7a29b17a4b16..9dca230ac0d5b 100644 --- a/nixos/modules/tasks/swraid.nix +++ b/nixos/modules/tasks/swraid.nix @@ -44,6 +44,16 @@ in { cp -v ${pkgs.mdadm}/lib/udev/rules.d/*.rules $out/ ''; + extraUtilsCommands = '' + # Add RAID mdadm tool. + copy_bin_and_libs ${pkgs.mdadm}/sbin/mdadm + copy_bin_and_libs ${pkgs.mdadm}/sbin/mdmon + ''; + + extraUtilsCommandsTest = '' + $out/bin/mdadm --version + ''; + extraFiles."/etc/mdadm.conf".source = pkgs.writeText "mdadm.conf" config.boot.swraid.mdadmConf; systemd = { |