From bdf230155f7bc8d4f88ad4cdaab54394de9ed614 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Sat, 11 May 2024 18:19:53 +0200 Subject: [PATCH] add daily auto rebuild for server --- hosts/server/configuration.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 9ca476e..0478276 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -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. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];