mob next [ci-skip] [ci skip] [skip ci]
lastFile:modules/nixos/inventree/default.nix
This commit is contained in:
@@ -17,6 +17,28 @@ let
|
|||||||
pkg = cfg.package;
|
pkg = cfg.package;
|
||||||
configFile = "${cfg.dataDir}/config.json";
|
configFile = "${cfg.dataDir}/config.json";
|
||||||
|
|
||||||
|
env = {
|
||||||
|
INVENTREE_CONFIG_FILE = configFile;
|
||||||
|
INVENTREE_SECRET_KEY_FILE = cfg.secretKeyFile;
|
||||||
|
INVENTREE_AUTO_UPDATE = "1";
|
||||||
|
INVENTREE_PLUGINS_ENABLED = "1";
|
||||||
|
INVENTREE_PLUGIN_NOINSTALL = "1";
|
||||||
|
INVENTREE_STATIC_ROOT = cfg.config.static_root;
|
||||||
|
INVENTREE_MEDIA_ROOT = cfg.config.media_root;
|
||||||
|
INVENTREE_BACKUP_DIR = cfg.config.backup_dir;
|
||||||
|
INVENTREE_OIDC_PRIVATE_KEY_FILE = cfg.config.oidc_private_key_file;
|
||||||
|
INVENTREE_DB_ENGINE = cfg.config.database.ENGINE;
|
||||||
|
INVENTREE_DB_NAME = cfg.config.database.NAME;
|
||||||
|
INVENTREE_DB_HOST = cfg.config.database.HOST;
|
||||||
|
INVENTREE_DB_USER = "inventree";
|
||||||
|
INVENTREE_ADMIN_USER = cfg.config.adminUser;
|
||||||
|
INVENTREE_ADMIN_PASSWORD_FILE = cfg.config.adminPasswordFile;
|
||||||
|
|
||||||
|
INVENTREE_SITE_URL = cfg.config.site_url;
|
||||||
|
|
||||||
|
PYTHONPATH = pkg.pythonPath;
|
||||||
|
};
|
||||||
|
|
||||||
inventree-invoke = pkgs.writeShellApplication {
|
inventree-invoke = pkgs.writeShellApplication {
|
||||||
name = "inventree-invoke";
|
name = "inventree-invoke";
|
||||||
text = ''
|
text = ''
|
||||||
@@ -233,27 +255,7 @@ in
|
|||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
};
|
};
|
||||||
environment = {
|
environment = env;
|
||||||
INVENTREE_CONFIG_FILE = configFile;
|
|
||||||
INVENTREE_SECRET_KEY_FILE = cfg.secretKeyFile;
|
|
||||||
INVENTREE_AUTO_UPDATE = "1";
|
|
||||||
INVENTREE_PLUGINS_ENABLED = "1";
|
|
||||||
INVENTREE_PLUGIN_NOINSTALL = "1";
|
|
||||||
INVENTREE_STATIC_ROOT = cfg.config.static_root;
|
|
||||||
INVENTREE_MEDIA_ROOT = cfg.config.media_root;
|
|
||||||
INVENTREE_BACKUP_DIR = cfg.config.backup_dir;
|
|
||||||
INVENTREE_OIDC_PRIVATE_KEY_FILE = cfg.config.oidc_private_key_file;
|
|
||||||
INVENTREE_DB_ENGINE = cfg.config.database.ENGINE;
|
|
||||||
INVENTREE_DB_NAME = cfg.config.database.NAME;
|
|
||||||
INVENTREE_DB_HOST = cfg.config.database.HOST;
|
|
||||||
INVENTREE_DB_USER = "inventree";
|
|
||||||
INVENTREE_ADMIN_USER = cfg.config.adminUser;
|
|
||||||
INVENTREE_ADMIN_PASSWORD_FILE = cfg.config.adminPasswordFile;
|
|
||||||
|
|
||||||
INVENTREE_SITE_URL = cfg.config.site_url;
|
|
||||||
|
|
||||||
PYTHONPATH = pkg.pythonPath;
|
|
||||||
};
|
|
||||||
script = ''
|
script = ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -270,26 +272,7 @@ in
|
|||||||
wantedBy = [ "inventree.target" ];
|
wantedBy = [ "inventree.target" ];
|
||||||
partOf = [ "inventree.target" ];
|
partOf = [ "inventree.target" ];
|
||||||
before = [ "inventree-gunicorn.service" ];
|
before = [ "inventree-gunicorn.service" ];
|
||||||
environment = {
|
environment = env;
|
||||||
INVENTREE_CONFIG_FILE = configFile;
|
|
||||||
INVENTREE_SECRET_KEY_FILE = cfg.secretKeyFile;
|
|
||||||
INVENTREE_AUTO_UPDATE = "1";
|
|
||||||
INVENTREE_PLUGINS_ENABLED = "1";
|
|
||||||
INVENTREE_PLUGIN_NOINSTALL = "1";
|
|
||||||
INVENTREE_STATIC_ROOT = cfg.config.static_root;
|
|
||||||
INVENTREE_MEDIA_ROOT = cfg.config.media_root;
|
|
||||||
INVENTREE_BACKUP_DIR = cfg.config.backup_dir;
|
|
||||||
INVENTREE_OIDC_PRIVATE_KEY_FILE = cfg.config.oidc_private_key_file;
|
|
||||||
INVENTREE_DB_ENGINE = cfg.config.database.ENGINE;
|
|
||||||
INVENTREE_DB_NAME = cfg.config.database.NAME;
|
|
||||||
INVENTREE_DB_HOST = cfg.config.database.HOST;
|
|
||||||
INVENTREE_DB_USER = "inventree";
|
|
||||||
INVENTREE_ADMIN_USER = cfg.config.adminUser;
|
|
||||||
INVENTREE_ADMIN_PASSWORD_FILE = cfg.config.adminPasswordFile;
|
|
||||||
INVENTREE_SITE_URL = cfg.config.site_url;
|
|
||||||
|
|
||||||
PYTHONPATH = pkg.pythonPath;
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "inventree";
|
User = "inventree";
|
||||||
Group = "inventree";
|
Group = "inventree";
|
||||||
@@ -307,26 +290,7 @@ in
|
|||||||
requiredBy = [ "inventree.target" ];
|
requiredBy = [ "inventree.target" ];
|
||||||
partOf = [ "inventree.target" ];
|
partOf = [ "inventree.target" ];
|
||||||
#wantedBy = [ "inventree.target" ];
|
#wantedBy = [ "inventree.target" ];
|
||||||
environment = {
|
environment = env;
|
||||||
INVENTREE_CONFIG_FILE = configFile;
|
|
||||||
INVENTREE_SECRET_KEY_FILE = cfg.secretKeyFile;
|
|
||||||
INVENTREE_AUTO_UPDATE = "1";
|
|
||||||
INVENTREE_PLUGINS_ENABLED = "1";
|
|
||||||
INVENTREE_PLUGIN_NOINSTALL = "1";
|
|
||||||
INVENTREE_STATIC_ROOT = cfg.config.static_root;
|
|
||||||
INVENTREE_MEDIA_ROOT = cfg.config.media_root;
|
|
||||||
INVENTREE_BACKUP_DIR = cfg.config.backup_dir;
|
|
||||||
INVENTREE_OIDC_PRIVATE_KEY_FILE = cfg.config.oidc_private_key_file;
|
|
||||||
INVENTREE_DB_ENGINE = cfg.config.database.ENGINE;
|
|
||||||
INVENTREE_DB_NAME = cfg.config.database.NAME;
|
|
||||||
INVENTREE_DB_HOST = cfg.config.database.HOST;
|
|
||||||
INVENTREE_DB_USER = "inventree";
|
|
||||||
INVENTREE_ADMIN_USER = cfg.config.adminUser;
|
|
||||||
INVENTREE_ADMIN_PASSWORD_FILE = cfg.config.adminPasswordFile;
|
|
||||||
INVENTREE_SITE_URL = cfg.config.site_url;
|
|
||||||
|
|
||||||
PYTHONPATH = pkg.pythonPath;
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "inventree";
|
User = "inventree";
|
||||||
Group = "inventree";
|
Group = "inventree";
|
||||||
@@ -351,26 +315,7 @@ in
|
|||||||
requiredBy = [ "inventree.target" ];
|
requiredBy = [ "inventree.target" ];
|
||||||
wantedBy = [ "inventree.target" ];
|
wantedBy = [ "inventree.target" ];
|
||||||
partOf = [ "inventree.target" ];
|
partOf = [ "inventree.target" ];
|
||||||
environment = {
|
environment = env;
|
||||||
INVENTREE_CONFIG_FILE = configFile;
|
|
||||||
INVENTREE_SECRET_KEY_FILE = cfg.secretKeyFile;
|
|
||||||
INVENTREE_AUTO_UPDATE = "1";
|
|
||||||
INVENTREE_PLUGINS_ENABLED = "0";
|
|
||||||
INVENTREE_PLUGIN_NOINSTALL = "1";
|
|
||||||
INVENTREE_STATIC_ROOT = cfg.config.static_root;
|
|
||||||
INVENTREE_MEDIA_ROOT = cfg.config.media_root;
|
|
||||||
INVENTREE_BACKUP_DIR = cfg.config.backup_dir;
|
|
||||||
INVENTREE_OIDC_PRIVATE_KEY_FILE = cfg.config.oidc_private_key_file;
|
|
||||||
INVENTREE_DB_ENGINE = cfg.config.database.ENGINE;
|
|
||||||
INVENTREE_DB_NAME = cfg.config.database.NAME;
|
|
||||||
INVENTREE_DB_HOST = cfg.config.database.HOST;
|
|
||||||
INVENTREE_DB_USER = "inventree";
|
|
||||||
INVENTREE_ADMIN_USER = cfg.config.adminUser;
|
|
||||||
INVENTREE_ADMIN_PASSWORD_FILE = cfg.config.adminPasswordFile;
|
|
||||||
INVENTREE_SITE_URL = cfg.config.site_url;
|
|
||||||
|
|
||||||
PYTHONPATH = pkg.pythonPath;
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "inventree";
|
User = "inventree";
|
||||||
Group = "inventree";
|
Group = "inventree";
|
||||||
|
|||||||
Reference in New Issue
Block a user