nixos-servers/system/weekly-rebuild.nix
Torjus Håkestad c089cbedee
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m45s
Periodic flake update / flake-update (push) Successful in 1m57s
Remove rebuild switch, messes with running unit
2024-10-12 21:59:28 +02:00

22 lines
537 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";
};
};
systemd.timers."weekly-rebuild" = {
enable = true;
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "Sun 06:00:00";
};
};
}