From 7d2124f9e3206166d82e72990cb5637c25a42b47 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Mon, 10 Jul 2023 20:31:13 +0200 Subject: stage-1: Only copy mdadm and mdmon into initramfs if enabled --- nixos/modules/tasks/swraid.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nixos/modules/tasks') diff --git a/nixos/modules/tasks/swraid.nix b/nixos/modules/tasks/swraid.nix index d7a29b17a4b..9dca230ac0d 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 = { -- cgit 1.4.1