From eaffd5ea6fa6039274b21f6baf19148bf9d39e92 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Sat, 11 May 2024 18:24:03 +0200 Subject: [PATCH] add update flake target to pc --- hosts/default/configuration.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 50134ad..4f5092b 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -226,6 +226,26 @@ rec { flatpak.enable = true; }; + systemd.timers."update-flake" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + }; + }; + + systemd.services."update-flake" = { + script = '' + nix flake update --commit-lock-file /home/noa/nixos/ + nixos-rebuild switch --flake /home/noa/nixos/ + git -C /home/noa/nixos/ push + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + environment.etc = { "fail2ban/filter.d/go-login.local".text = pkgs.lib.mkDefault (pkgs.lib.mkAfter '' [Definition]