auto update

This commit is contained in:
Sam 2025-01-16 17:51:47 +00:00
parent 80da4b731e
commit 69a2c4cfc8
2 changed files with 7 additions and 0 deletions

View File

@ -91,6 +91,7 @@ in {
system.services.nixosAutoUpgrade = {
enable = true;
persistent = true;
reboot = false;
pushUpdates = true;
configDir = "/etc/nixos";
onCalendar = "daily";

View File

@ -20,6 +20,11 @@ in
description = "Extra flags to pass to nixos-rebuild.";
default = "";
};
reboot = lib.mkOption {
type = lib.types.bool;
description = "Automatically reboots the system if there is a kernel or systemd update.";
default = false;
};
onCalendar = lib.mkOption {
default = "daily";
type = lib.types.str;
@ -70,6 +75,7 @@ in
(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.reboot) "--reboot ").content
(lib.mkIf (cfg.extraFlags != "") cfg.extraFlags).content
];
};