diff options
Diffstat (limited to '')
| -rw-r--r-- | machines/oxo/git-home.nix | 1 | ||||
| -rw-r--r-- | machines/oxo/home.nix | 1 | ||||
| -rw-r--r-- | modules/git/cron.nix | 28 | 
3 files changed, 25 insertions, 5 deletions
| diff --git a/machines/oxo/git-home.nix b/machines/oxo/git-home.nix index c2bff08..9d92422 100644 --- a/machines/oxo/git-home.nix +++ b/machines/oxo/git-home.nix @@ -7,6 +7,7 @@    };    home.packages = with pkgs; [ +    jq      git-lfs    ]; diff --git a/machines/oxo/home.nix b/machines/oxo/home.nix index 8672e15..c43b9b0 100644 --- a/machines/oxo/home.nix +++ b/machines/oxo/home.nix @@ -11,6 +11,7 @@      fzf      fd      ripgrep +    jq      unzip      zip diff --git a/modules/git/cron.nix b/modules/git/cron.nix index 26fb444..acb27bd 100644 --- a/modules/git/cron.nix +++ b/modules/git/cron.nix @@ -1,10 +1,28 @@  { config, lib, pkgs, ... }:  { -  services.cron = { -    enable = true; -    systemCronJobs = [ -      "* * * * *      git    /home/git/git-shell-commands/update-timestamps" -    ]; +  systemd.timers."update-timestamps" = { +    wantedBy = [ "timers.target" ]; +      timerConfig = { +        OnBootSec = "10s"; +        OnUnitActiveSec = "10s"; +        Unit = "update-timestamps.service"; +      }; +  }; + +  systemd.services."update-timestamps" = { +    script = '' +      REPOSITORIES=$(find /home/git/* -name '*.git' -type d) + +      for repo in $REPOSITORIES; do +        cd $repo +        mkdir -p info/web +        echo $(${pkgs.git}/bin/git log -1 --date=iso --format=%ci) > info/web/last-modified +      done +    ''; +    serviceConfig = { +      Type = "oneshot"; +      User = "git"; +    };    };  } | 
