diff --git a/modules/periodic.nix b/modules/periodic.nix index c54ed44..54484c7 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -77,4 +77,15 @@ in { }; after = [ "network.target" ]; }; + + # Garbage collect git repositories on a monthly basis + systemd.user.services.git-gc = { + description = "Garbage collect git repositories"; + path = [ git fd ]; + script = '' + ${pkgs.fd}/bin/fd -g -H --type directory '.git' /home/coolneng --exec git -C '{}' gc --aggressive + ''; + serviceConfig.Type = "oneshot"; + startAt = "*-*-13 17:00:00"; + }; }