remove timer
This commit is contained in:
parent
a7ac419f7f
commit
a554de2071
3 changed files with 0 additions and 45 deletions
|
|
@ -33,7 +33,6 @@
|
||||||
timers = {
|
timers = {
|
||||||
backup.enable = true;
|
backup.enable = true;
|
||||||
rooms.enable = true;
|
rooms.enable = true;
|
||||||
flakeUpdate.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,5 @@
|
||||||
./wol.nix
|
./wol.nix
|
||||||
./backup.nix
|
./backup.nix
|
||||||
./rooms.nix
|
./rooms.nix
|
||||||
./flakeUpdate.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkEnableOption mkIf;
|
|
||||||
cfg = config.horseman.timers.flakeUpdate;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
horseman.timers.flakeUpdate = {
|
|
||||||
enable = mkEnableOption "Updates flake.nix weekly";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
systemd.timers."flake-update" = {
|
|
||||||
wantedBy = ["timers.target"];
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "weekly";
|
|
||||||
Persistent = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services."flake-update" = let
|
|
||||||
git = "sudo -u horseman ${pkgs.git}/bin/git";
|
|
||||||
in {
|
|
||||||
script = ''
|
|
||||||
#!/run/current-system/sw/bin/zsh
|
|
||||||
cd /home/horseman/nix-config
|
|
||||||
${git} pull
|
|
||||||
sudo nix flake update
|
|
||||||
rebuild .#${config.networking.hostName}
|
|
||||||
${git} commit flake.lock -m "Update flake"
|
|
||||||
${git} push
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "root";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue