summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristoph Heiss <c.heiss@proxmox.com>2023-07-24 14:49:51 +0200
committerChristoph Heiss <christoph@c8h4.io>2023-11-11 13:01:47 +0100
commit6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f (patch)
treee3c94bb7a59a5199806da1c612d37dfc2d48f074
parent5841d27497905b0411cba48f0f4cc8c1a1c1edd4 (diff)
downloadnixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar.gz
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar.bz2
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar.lz
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar.xz
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.tar.zst
nixpkgs-6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f.zip
sourcehut: fix up some more bin paths
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix17
1 files changed, 9 insertions, 8 deletions
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index 5b16aa21d78..abe2370483c 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -408,8 +408,8 @@ in
               This setting is propagated to newer and existing repositories.
             '';
             type = types.str;
-            default = "${cfg.python}/bin/hgsrht-hook-changegroup";
-            defaultText = "\${cfg.python}/bin/hgsrht-hook-changegroup";
+            default = "${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup";
+            defaultText = "\${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup";
           };
           repos = mkOption {
             description = lib.mdDoc ''
@@ -795,10 +795,11 @@ in
       environment.etc."ssh/sourcehut/subdir/srht-dispatch" = {
         # sshd_config(5): The program must be owned by root, not writable by group or others
         mode = "0755";
-        source = pkgs.writeShellScript "srht-dispatch" ''
+        source = pkgs.writeShellScript "srht-dispatch-wrapper" ''
           set -e
+          set -x
           cd /etc/ssh/sourcehut/subdir
-          ${cfg.python}/bin/gitsrht-dispatch "$@"
+          ${pkgs.sourcehut.gitsrht}/bin/gitsrht-dispatch "$@"
         '';
       };
       systemd.services.sshd = {
@@ -882,7 +883,7 @@ in
                 set -e
                 test -e "''$PWD"/config.ini ||
                 ln -s /run/sourcehut/hgsrht/config.ini "''$PWD"/config.ini
-                exec -a "$0" ${cfg.python}/bin/hgsrht-hook-changegroup "$@"
+                exec -a "$0" ${pkgs.sourcehut.hgsrht}/bin/hgsrht-hook-changegroup "$@"
               ''}:/usr/bin/hgsrht-hook-changegroup"
             ];
         };
@@ -1195,7 +1196,7 @@ in
       extraServices.listssrht-lmtp = {
         wants = [ "postfix.service" ];
         unitConfig.JoinsNamespaceOf = optional cfg.postfix.enable "postfix.service";
-        serviceConfig.ExecStart = "${cfg.python}/bin/listssrht-lmtp";
+        serviceConfig.ExecStart = "${pkgs.sourcehut.listssrht}/bin/listssrht-lmtp";
         # Avoid crashing: os.chown(sock, os.getuid(), sock_gid)
         serviceConfig.PrivateUsers = mkForce false;
       };
@@ -1274,7 +1275,7 @@ in
             else
               # In order to load config.ini
               if cd /run/sourcehut/metasrht
-              then exec ${cfg.python}/bin/metasrht-manageuser "$@"
+              then exec ${pkgs.sourcehut.metasrht}/bin/metasrht-manageuser "$@"
               else cat <<EOF
                 Please run: sudo systemctl start metasrht
             EOF
@@ -1338,7 +1339,7 @@ in
       extraServices.todosrht-lmtp = {
         wants = [ "postfix.service" ];
         unitConfig.JoinsNamespaceOf = optional cfg.postfix.enable "postfix.service";
-        serviceConfig.ExecStart = "${cfg.python}/bin/todosrht-lmtp";
+        serviceConfig.ExecStart = "${pkgs.sourcehut.todosrht}/bin/todosrht-lmtp";
         # Avoid crashing: os.chown(sock, os.getuid(), sock_gid)
         serviceConfig.PrivateUsers = mkForce false;
       };