Formatting + update
This commit is contained in:
parent
93de64c64e
commit
9c895e9cc0
61 changed files with 2350 additions and 2100 deletions
|
|
@ -3,13 +3,10 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
}: let
|
||||
cfg = config.kylekrein.services.autoUpgrade;
|
||||
script = ./nixos-upgrade-script.sh;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
kylekrein.services.autoUpgrade = {
|
||||
enable = lib.mkEnableOption "Enables automatic system updates.";
|
||||
|
|
@ -69,15 +66,31 @@ in
|
|||
unitConfig.RequiresMountsFor = cfg.configDir;
|
||||
script =
|
||||
"${script} --operation ${cfg.operation} "
|
||||
+ (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 "");
|
||||
+ (
|
||||
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" ];
|
||||
after = [ "network-online.target" ];
|
||||
wantedBy = [ "timers.target" ];
|
||||
wants = ["network-online.target"];
|
||||
after = ["network-online.target"];
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
OnCalendar = cfg.onCalendar;
|
||||
Persistent = cfg.persistent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue