nixos/top-level: fix cutoffPackages without initialRamdisk
In systems without initrd (e.g. containers) that also use system.replaceDependencies, we'd get:
error: attribute 'initialRamdisk' missing
at /nix/store/8vfhnwmmzqqzy97q9c5m4bzyaqqf63zy-source/nixos/modules/system/activation/top-level.nix:286:21:
285| cutoffPackages = mkOption {
286| default = [ config.system.build.initialRamdisk ];
| ^
Make that initialRamdisk reference conditional on the initrd being enabled.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user