Skip to content

Commit

Permalink
Merge pull request #314917 from christoph-heiss/sourcehut-fix
Browse files Browse the repository at this point in the history
nixos: sourcehut: fix some binary paths
  • Loading branch information
tomberek authored Jun 23, 2024
2 parents c14a7da + 6729c6c commit 73d9240
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nixos/modules/services/misc/sourcehut/service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand All @@ -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
''}
Expand Down Expand Up @@ -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 { })
Expand Down

0 comments on commit 73d9240

Please sign in to comment.