about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authortomberek <tomberek@users.noreply.github.com>2024-06-23 18:43:57 -0400
committerGitHub <noreply@github.com>2024-06-23 18:43:57 -0400
commit73d924022e1b12ee9e634bbf57b87e9f115dbd32 (patch)
tree666390fb0a25ea03ee7b370e015856274142ed01 /nixos
parentc14a7da448d5713d42ed6c89a0b7cbe29c15a7d0 (diff)
parent6729c6c653f17a5f9f1dcf5439d3e98652406042 (diff)
Merge pull request #314917 from christoph-heiss/sourcehut-fix
nixos: sourcehut: fix some binary paths
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/sourcehut/service.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/sourcehut/service.nix b/nixos/modules/services/misc/sourcehut/service.nix
index ce5a0e78627c1..3507a49ea13a8 100644
--- a/nixos/modules/services/misc/sourcehut/service.nix
+++ b/nixos/modules/services/misc/sourcehut/service.nix
@@ -324,7 +324,8 @@ in
               };
               preStart =
                 let
-                  version = pkgs.sourcehut.${srvsrht}.version;
+                  package = pkgs.sourcehut.${srvsrht};
+                  version = package.version;
                   stateDir = "/var/lib/sourcehut/${srvsrht}";
                 in
                 mkBefore ''
@@ -336,14 +337,14 @@ in
                   if test ! -e ${stateDir}/db; then
                     # Setup the initial database.
                     # Note that it stamps the alembic head afterward
-                    ${cfg.python}/bin/${srvsrht}-initdb
+                    ${package}/bin/${srvsrht}-initdb
                     echo ${version} >${stateDir}/db
                   fi
 
                   ${optionalString cfg.settings.${iniKey}.migrate-on-upgrade ''
                     if [ "$(cat ${stateDir}/db)" != "${version}" ]; then
                       # Manage schema migrations using alembic
-                      ${cfg.python}/bin/${srvsrht}-migrate -a upgrade head
+                      ${package}/bin/${srvsrht}-migrate -a upgrade head
                       echo ${version} >${stateDir}/db
                     fi
                   ''}
@@ -389,7 +390,7 @@ in
               after = [ "network.target" "${srvsrht}.service" ];
               serviceConfig = {
                 Type = "oneshot";
-                ExecStart = "${cfg.python}/bin/${timerName}";
+                ExecStart = "${pkgs.sourcehut.${srvsrht}}/bin/${timerName}";
               };
             }
             (timer.service or { })