From adb928573cfbb85e37eb50c1e40082b892d38ea7 Mon Sep 17 00:00:00 2001 From: Andre Date: Wed, 23 Oct 2024 09:44:29 -0400 Subject: [PATCH] Services: fix autoupgrade including --update when not specified --- modules/services/autoupgrade.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/services/autoupgrade.nix b/modules/services/autoupgrade.nix index 63c3107..d2788fd 100644 --- a/modules/services/autoupgrade.nix +++ b/modules/services/autoupgrade.nix @@ -65,13 +65,12 @@ in }; path = config.aux.system.corePackages; unitConfig.RequiresMountsFor = cfg.configDir; - script = lib.strings.concatStrings [ + script = "/run/current-system/sw/bin/nixos-operations-script --operation ${cfg.operation} " - (lib.mkIf (cfg.configDir != "") "--flake ${cfg.configDir} ").content - (lib.mkIf (cfg.user != "") "--user ${cfg.user} ").content - (lib.mkIf (cfg.pushUpdates) "--update ").content - (lib.mkIf (cfg.extraFlags != "") cfg.extraFlags).content - ]; + + (if (cfg.configDir != "") then "--flake ${cfg.configDir} " else "") + + (if (cfg.user != "") then "--user ${cfg.user} " else "") + + (if (cfg.pushUpdates) then "--update " else "") + + (if (cfg.extraFlags != "") then cfg.extraFlags else ""); }; timers."nixos-upgrade" = { wants = [ "network-online.target" ];