diff --git a/lib/tests.nix b/lib/tests.nix index f6e3ba4..e305f4c 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -171,9 +171,14 @@ let lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform config.boot.zfs.package) "zfs"; networking.hostId = "8425e349"; }) + + (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then { + boot.swraid.enable = true; + } else { + boot.initrd.services.swraid.enable = true; + }) ]; - boot.initrd.services.swraid.enable = true; systemd.services.mdmonitor.enable = false; # silence some weird warnings environment.systemPackages = [ @@ -265,4 +270,3 @@ let }; in testLib - diff --git a/lib/types/mdadm.nix b/lib/types/mdadm.nix index 0a073bb..ca99f9c 100644 --- a/lib/types/mdadm.nix +++ b/lib/types/mdadm.nix @@ -59,7 +59,13 @@ internal = true; readOnly = true; default = - [{ boot.initrd.services.swraid.enable = true; }] ++ + [ + (if lib.versionAtLeast (lib.versions.majorMinor lib.version) "23.11" then { + boot.swraid.enable = true; + } else { + boot.initrd.services.swraid.enable = true; + }) + ] ++ lib.optional (config.content != null) config.content._config; description = "NixOS configuration"; };