BUGFIX: fix conditional script construction in nixosAutoUpgrade.nix module

This commit is contained in:
Sam 2025-01-18 11:48:32 +00:00
parent d20f09ac39
commit 68c7d6d852
1 changed files with 5 additions and 5 deletions

View File

@ -72,11 +72,11 @@ in
unitConfig.RequiresMountsFor = cfg.configDir; unitConfig.RequiresMountsFor = cfg.configDir;
script = lib.strings.concatStrings [ script = lib.strings.concatStrings [
"${auto-update-nixos}/bin/auto-update-nixos --operation ${cfg.operation} " "${auto-update-nixos}/bin/auto-update-nixos --operation ${cfg.operation} "
(lib.mkIf (cfg.configDir != "") "--flake ${cfg.configDir} ").content (if cfg.configDir != "" then "--flake ${cfg.configDir} " else "")
(lib.mkIf (cfg.user != "") "--user ${cfg.user} ").content (if cfg.user != "" then "--user ${cfg.user} " else "")
(lib.mkIf (cfg.pushUpdates) "--update ").content (if cfg.pushUpdates then "--update " else "")
(lib.mkIf (cfg.reboot) "--reboot ").content (if cfg.reboot then "--reboot " else "")
(lib.mkIf (cfg.extraFlags != "") cfg.extraFlags).content cfg.extraFlags
]; ];
}; };
timers."nixos-upgrade" = { timers."nixos-upgrade" = {