From af5909a27258322eba8e207c2aca68c877020ef8 Mon Sep 17 00:00:00 2001 From: Danylo Hlynskyi Date: Thu, 7 Mar 2019 02:09:02 +0200 Subject: 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 --- nixos/modules/tasks/auto-upgrade.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/tasks/auto-upgrade.nix b/nixos/modules/tasks/auto-upgrade.nix index d225778a3878..91f4ae79ee91 100644 --- a/nixos/modules/tasks/auto-upgrade.nix +++ b/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; }; }; -- cgit 1.4.1