diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2022-11-08 01:54:14 -0500 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2023-01-07 12:20:03 +0100 |
commit | 2fc85042238006704f6203c14814ca9da1f49b64 (patch) | |
tree | bd70fc866185798c06abce266bc122ff904d344b /nixos/modules/services | |
parent | aefc89e236bfe2ef4fcd757738f6f912cd5dcddd (diff) |
nixos/etebase-server: Leverage $PATH
This simplifies the existing module but also enables consumers to call `etebase-server` from custom preStart commands (i.e. user creation commands).
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/misc/etebase-server.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/etebase-server.nix b/nixos/modules/services/misc/etebase-server.nix index c3723d188146b..045048a1a2e32 100644 --- a/nixos/modules/services/misc/etebase-server.nix +++ b/nixos/modules/services/misc/etebase-server.nix @@ -179,21 +179,21 @@ in description = "An Etebase (EteSync 2.0) server"; after = [ "network.target" "systemd-tmpfiles-setup.service" ]; wantedBy = [ "multi-user.target" ]; + path = [ pythonEnv ]; serviceConfig = { User = cfg.user; Restart = "always"; WorkingDirectory = cfg.dataDir; }; environment = { - PYTHONPATH = "${pythonEnv}/${pkgs.python3.sitePackages}"; ETEBASE_EASY_CONFIG_PATH = configIni; }; preStart = '' # Auto-migrate on first run or if the package has changed versionFile="${cfg.dataDir}/src-version" if [[ $(cat "$versionFile" 2>/dev/null) != ${pkgs.etebase-server} ]]; then - ${pythonEnv}/bin/etebase-server migrate --no-input - ${pythonEnv}/bin/etebase-server collectstatic --no-input --clear + etebase-server migrate --no-input + etebase-server collectstatic --no-input --clear echo ${pkgs.etebase-server} > "$versionFile" fi ''; @@ -204,7 +204,7 @@ in else "-b 0.0.0.0 -p ${toString cfg.port}"; in '' cd "${pythonEnv}/lib/etebase-server"; - ${pythonEnv}/bin/daphne ${networking} \ + daphne ${networking} \ etebase_server.asgi:application ''; }; |