From 241c878d4b542fea7c61ed4421e9224af054ff56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 11 Aug 2023 08:32:16 +0200 Subject: [PATCH] drop deprecated boot.initrd.services.swraid.enable option --- lib/tests.nix | 8 ++++++-- lib/types/mdadm.nix | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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"; };