diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 875e2d5410b3..9d33c4a79708 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -283,8 +283,8 @@ in }; cutoffPackages = mkOption { - default = [ config.system.build.initialRamdisk ]; - defaultText = literalExpression "[ config.system.build.initialRamdisk ]"; + default = lib.optionals config.boot.initrd.enable [ config.system.build.initialRamdisk ]; + defaultText = literalExpression "lib.optionals config.boot.initrd.enable [ config.system.build.initialRamdisk ]"; type = types.listOf types.package; description = '' Packages to which no replacements should be applied.