My Nix Configuration
1{ pkgs, lib, ... }: 2{ 3 systemd.timers.blog-update = { 4 enable = false; 5 after = [ "network.target" ]; 6 wantedBy = [ "multi-user.target" ]; 7 description = "Blog Update Timer"; 8 timerConfig = { 9 Unit = "blog-update.service"; 10 OnUnitActiveSec = 300; 11 }; 12 }; 13 14 systemd.services.blog-update = { 15 enable = false; 16 wantedBy = [ "multi-user.target" ]; 17 description = "Blog Update Service"; 18 path = [ 19 "${pkgs.git}" 20 ]; 21 serviceConfig = { 22 WorkingDirectory = "/var/www/blog"; 23 User = "caddy"; 24 Group = "caddy"; 25 Type = "oneshot"; 26 ExecStartPre = "${lib.getExe pkgs.git} fetch origin pages"; 27 ExecStart = "${lib.getExe pkgs.git} reset --hard origin/pages"; 28 }; 29 }; 30}