diff --git a/nixos/modules/services/misc/tandoor-recipes.nix b/nixos/modules/services/misc/tandoor-recipes.nix index 549b3ad5fa3d..10d28c390a38 100644 --- a/nixos/modules/services/misc/tandoor-recipes.nix +++ b/nixos/modules/services/misc/tandoor-recipes.nix @@ -119,6 +119,12 @@ in after = lib.optional cfg.database.createLocally "postgresql.target"; serviceConfig = { + ExecStartPre = [ + "${lib.getExe' pkgs.coreutils "ln"} -sf ${manage} tandoor-recipes-manage" + + # Let django migrate the DB as needed + "${lib.getExe pkg} migrate" + ]; ExecStart = '' ${pkg.python.pkgs.gunicorn}/bin/gunicorn recipes.wsgi ''; @@ -172,13 +178,6 @@ in wantedBy = [ "multi-user.target" ]; - preStart = '' - ln -sf ${manage} tandoor-recipes-manage - - # Let django migrate the DB as needed - ${pkg}/bin/tandoor-recipes migrate - ''; - environment = env // { PYTHONPATH = "${pkg.python.pkgs.makePythonPath pkg.propagatedBuildInputs}:${pkg}/lib/tandoor-recipes"; };