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
wip/yesman
Danylo Hlynskyi 5 years ago committed by GitHub
parent 502a4263a3
commit af5909a272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      nixos/modules/tasks/auto-upgrade.nix

@ -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;
};
};

Loading…
Cancel
Save