From 3f90386b24b02118f386a44ffbd9d8a40f289981 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sun, 22 Sep 2024 22:04:30 +0530 Subject: [PATCH 1/2] nixos/lvm: enable lvm when using systemd in stage 1 initrd Fixes https://github.com/NixOS/nixpkgs/issues/343566 --- nixos/modules/tasks/lvm.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/tasks/lvm.nix b/nixos/modules/tasks/lvm.nix index 0b628725969a8..4d1018978eaf1 100644 --- a/nixos/modules/tasks/lvm.nix +++ b/nixos/modules/tasks/lvm.nix @@ -31,6 +31,8 @@ in { Whether to enable booting from LVM2 in the initrd. ''; + default = config.boot.initrd.systemd.enable && config.services.lvm.enable; + defaultText = lib.literalExpression "config.boot.initrd.systemd.enable && config.services.lvm.enable"; }; config = mkMerge [ From 468a6cbbbef5a3d621e0deac86324e2bd69307a3 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:37:51 +0530 Subject: [PATCH 2/2] nixos/bcache: enable bcache when using systemd in stage 1 initrd --- nixos/modules/tasks/bcache.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/tasks/bcache.nix b/nixos/modules/tasks/bcache.nix index ba34498746227..d2c816d663f94 100644 --- a/nixos/modules/tasks/bcache.nix +++ b/nixos/modules/tasks/bcache.nix @@ -11,6 +11,8 @@ in { Whether to enable bcache support in the initrd. ''; + default = config.boot.initrd.systemd.enable && config.boot.bcache.enable; + defaultText = lib.literalExpression "config.boot.initrd.systemd.enable && config.boot.bcache.enable"; }; config = lib.mkIf cfg.enable {