From e0c794dfdb62730650414d6b80b2d7e2899caeb5 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 19 Jan 2022 16:06:50 +0100 Subject: [PATCH] Garbage collect git repositories monthly --- modules/periodic.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"; + }; }