Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -1,11 +1,12 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.docs-manager;
|
||||
cfg = rootCfg.paperless-ngx;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.docs-manager;
|
||||
cfg = moduleCfg.paperless-ngx;
|
||||
domain = "${config.sops.placeholder."domains/serv"}";
|
||||
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
|
||||
pocketIdSubdomain = rootCfg.pocket-id.subdomain;
|
||||
socialAccountProviders = builtins.toJSON {
|
||||
openid_connect = {
|
||||
OAUTH_PKCE_ENABLED = true;
|
||||
@@ -31,7 +32,7 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
sops.secrets = {
|
||||
"paperless-ngx/client_secret" = { };
|
||||
"paperless-ngx/secret_key" = { };
|
||||
@@ -43,9 +44,9 @@ in
|
||||
PAPERLESS_URL=https://${cfg.subdomain}.${domain}
|
||||
PAPERLESS_SECRET_KEY=${config.sops.placeholder."paperless-ngx/secret_key"}
|
||||
PAPERLESS_TIME_ZONE=${config.time.timeZone}
|
||||
PAPERLESS_REDIS=redis://${rootCfg.redis.name}:6379
|
||||
PAPERLESS_REDIS=redis://${moduleCfg.redis.name}:6379
|
||||
PAPERLESS_DBENGINE=postgresql
|
||||
PAPERLESS_DBHOST=${rootCfg.postgres.name}
|
||||
PAPERLESS_DBHOST=${moduleCfg.postgres.name}
|
||||
PAPERLESS_DBPORT=5432
|
||||
PAPERLESS_DBNAME=paperless
|
||||
PAPERLESS_DBUSER=paperless
|
||||
@@ -59,8 +60,8 @@ in
|
||||
PAPERLESS_OCR_LANGUAGES=eng rus
|
||||
|
||||
PAPERLESS_TIKA_ENABLED=1
|
||||
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://${rootCfg.tika.gotenbergName}:3000
|
||||
PAPERLESS_TIKA_ENDPOINT=http://${rootCfg.tika.name}:9998
|
||||
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://${moduleCfg.tika.gotenbergName}:3000
|
||||
PAPERLESS_TIKA_ENDPOINT=http://${moduleCfg.tika.name}:9998
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.docs-manager;
|
||||
cfg = rootCfg.paperless-ngx;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.docs-manager;
|
||||
cfg = moduleCfg.paperless-ngx;
|
||||
hostDataPath = "${common.dataDir}/${cfg.name}";
|
||||
in
|
||||
{
|
||||
@@ -21,7 +22,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
image = "ghcr.io/paperless-ngx/paperless-ngx:2.15.3";
|
||||
ports = [
|
||||
@@ -51,13 +52,13 @@ in
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
after = [
|
||||
"${common.backend}-${rootCfg.redis.name}.service"
|
||||
"${common.backend}-${rootCfg.postgres.name}.service"
|
||||
"${common.backend}-${rootCfg.tika.gotenbergName}.service"
|
||||
"${common.backend}-${rootCfg.tika.name}.service"
|
||||
"${common.backend}-${moduleCfg.redis.name}.service"
|
||||
"${common.backend}-${moduleCfg.postgres.name}.service"
|
||||
"${common.backend}-${moduleCfg.tika.gotenbergName}.service"
|
||||
"${common.backend}-${moduleCfg.tika.name}.service"
|
||||
];
|
||||
preStart = ''
|
||||
mkdir -p ${hostDataPath}/data ${hostDataPath}/media ${hostDataPath}/export ${hostDataPath}/consume
|
||||
|
||||
Reference in new issue
Block a user