2024-10-12 19:27:02 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
systemd.services."weekly-rebuild" = {
|
2024-10-12 19:52:05 +00:00
|
|
|
path = [
|
|
|
|
pkgs.git
|
|
|
|
pkgs.nix
|
|
|
|
];
|
2024-10-12 19:27:02 +00:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
2024-10-12 19:52:05 +00:00
|
|
|
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild boot --flake git+https://git.t-juice.club/torjus/nixos-servers#";
|
|
|
|
ExecStartPost = [
|
|
|
|
"${pkgs.nix}/bin/nix-collect-garbage --delete-older-than 30d"
|
|
|
|
"${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake git+https://git.t-juice.club/torjus/nixos-servers#"
|
|
|
|
];
|
2024-10-12 19:27:02 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.timers."weekly-rebuild" = {
|
|
|
|
enable = true;
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "Sun 06:00:00";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|