Garbage collect git repositories monthly

This commit is contained in:
coolneng 2022-01-19 16:06:50 +01:00
parent 2591de7f3d
commit e0c794dfdb
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 11 additions and 0 deletions

View File

@ -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";
};
}