summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-09-11 09:11:10 +0300
committerGitHub <noreply@github.com>2023-09-11 09:11:10 +0300
commita604b522be970c1c1d627908179e3ab229d82685 (patch)
tree954b391144ee66c0e9b496cd086c4d97536df5bf
parentMerge pull request #245854 from OPNA2608/update/mir (diff)
parentnixos/swraid: fix regression for old initrd and add test coverage (diff)
downloadnixpkgs-a604b522be970c1c1d627908179e3ab229d82685.tar.gz
Merge pull request #254429 from ctheune/fix-swraid-for-old-init
nixos/swraid: fix regression for old initrd and add test coverage
-rw-r--r--nixos/modules/tasks/swraid.nix2
-rw-r--r--nixos/tests/systemd-initrd-swraid.nix3
2 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/tasks/swraid.nix b/nixos/modules/tasks/swraid.nix
index 8985660d80a7..1174187062d7 100644
--- a/nixos/modules/tasks/swraid.nix
+++ b/nixos/modules/tasks/swraid.nix
@@ -67,7 +67,7 @@ in {
$out/bin/mdadm --version
'';
- extraFiles."/etc/mdadm.conf" = mdadm_conf;
+ extraFiles."/etc/mdadm.conf".source = pkgs.writeText "mdadm.conf" mdadm_conf.text;
systemd = {
contents."/etc/mdadm.conf".text = mdadm_conf.text;
diff --git a/nixos/tests/systemd-initrd-swraid.nix b/nixos/tests/systemd-initrd-swraid.nix
index cb5b1cb4f535..d00e67b5705a 100644
--- a/nixos/tests/systemd-initrd-swraid.nix
+++ b/nixos/tests/systemd-initrd-swraid.nix
@@ -32,6 +32,9 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
};
specialisation.boot-swraid.configuration.virtualisation.rootDevice = "/dev/disk/by-label/testraid";
+ # This protects against a regression. We do not have to switch to it.
+ # It's sufficient to trigger its evaluation.
+ specialisation.build-old-initrd.configuration.boot.initrd.systemd.enable = lib.mkForce false;
};
testScript = ''