fix databasePath
This commit is contained in:
parent
669939f2c1
commit
6038aad312
|
@ -18,13 +18,16 @@ e11sync-backend: {
|
|||
type = port;
|
||||
default = 8002;
|
||||
};
|
||||
databasePath = lib.mkOption {
|
||||
type = path;
|
||||
default = "/var/lib/e11sync-backend/db.sqlite3";
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.e11sync;
|
||||
pkg-backend = e11sync-backend.override {
|
||||
inherit (cfg) backendPort;
|
||||
databasePath = "/var/lib/e11sync/db.sqlite3";
|
||||
inherit (cfg) backendPort databasePath;
|
||||
};
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
|
@ -36,11 +39,13 @@ e11sync-backend: {
|
|||
e11sync-backend = {
|
||||
description = "e11sync backend";
|
||||
environment = lib.mkMerge [
|
||||
{TZ = "UTC";}
|
||||
(lib.mkIf (cfg.secretKeyPath != "unsafe")
|
||||
{
|
||||
E11SYNC_SECRET_KEY_PATH = "/run/credentials/secret_key";
|
||||
})
|
||||
{
|
||||
TZ = "UTC";
|
||||
E11SYNC_DATABASE_PATH = cfg.databasePath;
|
||||
}
|
||||
(lib.mkIf (cfg.secretKeyPath != "unsafe") {
|
||||
E11SYNC_SECRET_KEY_PATH = "/run/credentials/secret_key";
|
||||
})
|
||||
];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = lib.mkMerge [
|
||||
|
@ -48,9 +53,10 @@ e11sync-backend: {
|
|||
Type = "notify";
|
||||
NotifyAccess = "all";
|
||||
Restart = "on-failure";
|
||||
RuntimeDirectory = "e11sync";
|
||||
StateDirectory = "e11sync";
|
||||
WorkingDirectory = "/var/lib/e11sync";
|
||||
RuntimeDirectory = "e11sync-backend";
|
||||
StateDirectory = "e11sync-backend";
|
||||
WorkingDirectory = "/var/lib/e11sync-backend";
|
||||
KillSignal = "SIGQUIT";
|
||||
ExecStart = "${pkg-backend}/bin/e11sync-backend";
|
||||
|
||||
DynamicUser = true;
|
||||
|
|
|
@ -32,6 +32,9 @@ in
|
|||
installPhase = ''
|
||||
cp -r . $out/app
|
||||
makeWrapper $out/app/manage.py $out/bin/e11sync \
|
||||
${lib.optionalString (databasePath != null) ''
|
||||
--set E11SYNC_DATABASE_PATH "${databasePath}" \
|
||||
''} \
|
||||
--set GEOIP_PATH "${geoip-mmdb}"
|
||||
|
||||
makeWrapper ${uwsgi-python}/bin/uwsgi $out/bin/e11sync-backend \
|
||||
|
|
Loading…
Reference in New Issue