add daily auto rebuild for server

This commit is contained in:
Noa Aarts 2024-05-11 18:19:53 +02:00
parent 2748b3ba9c
commit bdf230155f

View file

@ -117,6 +117,22 @@
}; };
}; };
systemd.timers."update-from-flake" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
systemd.services."update-from-flake" = {
script = ''nixos-rebuild switch --flake github:itepastra/nixconf'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];