From 5b4d1acbf5b85b827010cba6c3161ca958d08c0e Mon Sep 17 00:00:00 2001 From: Robert Rose Date: Tue, 24 Mar 2026 13:46:44 +0100 Subject: [PATCH] nixos/lvm: add option for adding lvresize_fs_helper to config Adding `lvresize_fs_helper` unconditionally to the config pulls in bash and thus defeats the efforts of enabling lvm without pulling in bash. --- nixos/modules/tasks/lvm.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/tasks/lvm.nix b/nixos/modules/tasks/lvm.nix index 8cf2db05dff4..4b33b3e79ed0 100644 --- a/nixos/modules/tasks/lvm.nix +++ b/nixos/modules/tasks/lvm.nix @@ -22,6 +22,10 @@ in ''; }; + resizeHelper.enable = mkEnableOption "lvresize_fs_helper" // { + default = true; + }; + package = mkOption { type = types.package; default = pkgs.lvm2; @@ -60,7 +64,7 @@ in services.udev.packages = [ cfg.package.out ]; environment.etc."lvm/lvm.conf".text = - "global/lvresize_fs_helper_executable = ${pkgs.lvm2.scripts}/libexec/lvresize_fs_helper"; + mkIf cfg.resizeHelper.enable "global/lvresize_fs_helper_executable = ${pkgs.lvm2.scripts}/libexec/lvresize_fs_helper"; }) (mkIf config.boot.initrd.services.lvm.enable { # We need lvm2 for the device-mapper rules