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:
Danylo Hlynskyi 2019-03-07 02:09:02 +02:00 committed by GitHub
parent 502a4263a3
commit af5909a272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ let cfg = config.system.autoUpgrade; in
};
config = {
config = lib.mkIf cfg.enable {
system.autoUpgrade.flags =
[ "--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}
'';
startAt = optional cfg.enable cfg.dates;
startAt = cfg.dates;
};
};