auto update
This commit is contained in:
parent
80da4b731e
commit
69a2c4cfc8
|
@ -91,6 +91,7 @@ in {
|
|||
system.services.nixosAutoUpgrade = {
|
||||
enable = true;
|
||||
persistent = true;
|
||||
reboot = false;
|
||||
pushUpdates = true;
|
||||
configDir = "/etc/nixos";
|
||||
onCalendar = "daily";
|
||||
|
|
|
@ -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
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue