From 5b4d1acbf5b85b827010cba6c3161ca958d08c0e Mon Sep 17 00:00:00 2001 From: Robert Rose Date: Tue, 24 Mar 2026 13:46:44 +0100 Subject: [PATCH 1/2] 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 From b2abc2a2fd97a73f35c39dd42f459fa553750ea8 Mon Sep 17 00:00:00 2001 From: Robert Rose Date: Tue, 24 Mar 2026 15:21:23 +0100 Subject: [PATCH 2/2] nixos/profiles: disable lvm resize helper in bashless profile --- nixos/modules/profiles/bashless.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/profiles/bashless.nix b/nixos/modules/profiles/bashless.nix index 572f665bfede..501563b97b3d 100644 --- a/nixos/modules/profiles/bashless.nix +++ b/nixos/modules/profiles/bashless.nix @@ -35,6 +35,8 @@ users.manageLingering = lib.mkDefault false; # Relies on the gzip command which depends on bash services.logrotate.enable = lib.mkDefault false; + # The resize helper pulls in bash + services.lvm.resizeHelper.enable = false; # Check that the system does not contain a Nix store path that contains the # string "bash".