nixos-servers/system/weekly-rebuild.nix
Torjus Håkestad b7d9a12786
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m36s
Collect garbage after rebuild
2024-10-12 21:53:34 +02:00

25 lines
671 B
Nix

{ pkgs, ... }:
{
systemd.services."weekly-rebuild" = {
path = [
pkgs.git
pkgs.nix
];
serviceConfig = {
Type = "oneshot";
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#"
];
};
};
systemd.timers."weekly-rebuild" = {
enable = true;
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "Sun 06:00:00";
};
};
}