3
0
Fork 0
forked from mirrors/nixpkgs

nixos/sourcehut: fix links to gitsrht-update-hook

This commit is contained in:
Julien Moutinho 2021-11-12 11:57:42 +01:00 committed by Tom Bereknyei
parent ac2a39ac75
commit e1549f5df9

View file

@ -1004,6 +1004,15 @@ in
inherit configIniOfService;
mainService = mkMerge [ baseService {
serviceConfig.StateDirectory = [ "sourcehut/gitsrht" "sourcehut/gitsrht/repos" ];
preStart = mkIf (!versionAtLeast config.system.stateVersion "22.05") (mkBefore ''
# Fix Git hooks of repositories pre-dating https://github.com/NixOS/nixpkgs/pull/133984
(
set +f
shopt -s nullglob
for h in /var/lib/sourcehut/gitsrht/repos/~*/*/hooks/{pre-receive,update,post-update}
do ln -fnsv /usr/bin/gitsrht-update-hook "$h"; done
)
'');
} ];
port = 5001;
webhooks = true;