summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJulien Moutinho <julm+nixpkgs@sourcephile.fr>2021-11-12 11:57:42 +0100
committerTom Bereknyei <tomberek@gmail.com>2021-12-28 22:18:44 -0500
commite1549f5df926ace00803b191b799b0c7a02ec2c8 (patch)
tree4841b9cde04074c079a7591dc429d363e96105ee /nixos
parentac2a39ac75f769407de6ada8d067000fcbc7ca0f (diff)
downloadnixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar.gz
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar.bz2
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar.lz
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar.xz
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.tar.zst
nixpkgs-e1549f5df926ace00803b191b799b0c7a02ec2c8.zip
nixos/sourcehut: fix links to gitsrht-update-hook
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index 2a7a45859f2..f482c352397 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -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;