mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
nixos/auto-upgrade: enable service only when it's enabled in options (#56948)
* nixos/auto-upgrade: enable service only when it's enabled in options This reduced closure size of `tinyContainer` from 449 MB to 403 MB
This commit is contained in:
parent
502a4263a3
commit
af5909a272
@ -57,7 +57,7 @@ let cfg = config.system.autoUpgrade; in
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
system.autoUpgrade.flags =
|
system.autoUpgrade.flags =
|
||||||
[ "--no-build-output" ]
|
[ "--no-build-output" ]
|
||||||
@ -84,7 +84,7 @@ let cfg = config.system.autoUpgrade; in
|
|||||||
${config.system.build.nixos-rebuild}/bin/nixos-rebuild switch ${toString cfg.flags}
|
${config.system.build.nixos-rebuild}/bin/nixos-rebuild switch ${toString cfg.flags}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
startAt = optional cfg.enable cfg.dates;
|
startAt = cfg.dates;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user