]> gitweb.ps.run Git - flake_server/blobdiff - configuration.nix
update the git-hooks rev to use the version that runs chmod +x
[flake_server] / configuration.nix
index a7068cd5dc65d5c58b1c6ecea060bbe419edadc5..71a0b67f0f60c99de4cd51c03c2fe3d49e1cdcae 100644 (file)
     senc = "sudo ${pkgs.helix}/bin/hx /etc/nixos/configuration.nix";
   };
 
+  # git-hooks
+  system.activationScripts.githook =
+    let
+      githooksRepo = pkgs.fetchgit {
+        url = "git://psch.dev/git-hooks";
+        rev = "1a40e097c8854d5a0e65c070addaa7e3337635c0";
+        hash = "sha256-KNKnP/3hhQQlildzRF+skYHtV+7Xg1MQMPi2DDEHGAI=";
+      };
+    in
+    {
+    text = ''
+      PATH=$PATH:${lib.makeBinPath [ pkgs.git pkgs.sudo pkgs.python3 ]} sudo -u git ${githooksRepo}/git-hooks/post-receive
+    '';
+  };
+
   # git
   users.users.git = {
     isSystemUser = true;
   services.caddy = {
     enable = true;
     virtualHosts."psch.dev".extraConfig = ''
+      basic_auth /julius_cam/* { test $2a$14$iKv0GlwavCunG0zQbaf2fOl4r4/8k8gDKUVUouu9Q3o.MfSDkp6Te }
       root * /srv/www
       file_server
     '';
-    virtualHosts."julius.psch.dev".extraConfig = ''
-      basic_auth { test $2a$14$iKv0GlwavCunG0zQbaf2fOl4r4/8k8gDKUVUouu9Q3o.MfSDkp6Te }
-      root * /srv/julius_cam
-      file_server
-    '';
     virtualHosts."chirp.psch.dev".extraConfig = ''
       reverse_proxy http://localhost:8080 {
         request_buffers 8192
             section-from-path=1
             virtual-root=/
             module-link=/%s/commit/?id=%s
-            clone-url=https://git.psch.dev/$CGIT_REPO_URL git://psch.dev/$CGIT_REPO_URL ssh://git@psch.dev:$CGIT_REPO_URL
+            clone-url=https://git.psch.dev/$CGIT_REPO_URL git://psch.dev/$CGIT_REPO_URL ssh://git@psch.dev/~/$CGIT_REPO_URL
             noplainemail=1
             side-by-side-diffs=1
             about-filter=${pkgs.writeShellScript "markdown-filter" ''