mob next [ci-skip] [ci skip] [skip ci]
lastFile:modules/nixos/inventree/default.nix
This commit is contained in:
@@ -32,11 +32,17 @@
|
||||
group = "inventree";
|
||||
secret = true;
|
||||
};
|
||||
admin-password = {
|
||||
owner = "inventree";
|
||||
group = "inventree";
|
||||
secret = true;
|
||||
};
|
||||
};
|
||||
runtimeInputs = [ pkgs.pwgen ];
|
||||
script = ''
|
||||
pwgen -s 32 1 > $out/secret-key
|
||||
pwgen -s 32 1 > $out/oidc-key
|
||||
pwgen -s 32 1 > $out/admin-password
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -48,6 +54,7 @@
|
||||
config.site_url = "http://${config.services.inventree.hostName}";
|
||||
secretKeyFile = config.clan.core.vars.generators.inventree.files.secret-key.path;
|
||||
config.oidc_private_key_file = config.clan.core.vars.generators.inventree.files.oidc-key.path;
|
||||
config.adminPasswordFile = config.clan.vars.generators.inventree.files.admin-password.path;
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
|
@@ -66,6 +66,14 @@ in
|
||||
type = types.submodule ({
|
||||
freeformType = configFormat.type;
|
||||
options = {
|
||||
adminUser = mkOption {
|
||||
type = types.str;
|
||||
default = "admin";
|
||||
};
|
||||
adminPasswordFile = mkOption {
|
||||
type = types.path;
|
||||
description = "Path to password file for user `admin`";
|
||||
};
|
||||
site_url = mkOption {
|
||||
type = types.str;
|
||||
default = "https://${cfg.hostName}";
|
||||
@@ -238,6 +246,8 @@ in
|
||||
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;
|
||||
|
||||
@@ -273,6 +283,8 @@ in
|
||||
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;
|
||||
@@ -308,6 +320,8 @@ in
|
||||
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;
|
||||
@@ -350,6 +364,8 @@ in
|
||||
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;
|
||||
|
Reference in New Issue
Block a user