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,12 +1,12 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
rootCfg = config.selfhosted.seafile;
|
||||
moduleCfg = config.selfhosted.seafile;
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
sops.templates."seadoc.env".content = ''
|
||||
DB_HOST=${rootCfg.mariadb.name}
|
||||
DB_HOST=${moduleCfg.mariadb.name}
|
||||
DB_PORT=3306
|
||||
DB_USER=seafile
|
||||
DB_PASSWORD=${config.sops.placeholder."seafile/mysql_password"}
|
||||
@@ -14,7 +14,7 @@ in
|
||||
TIME_ZONE=${config.time.timeZone}
|
||||
JWT_PRIVATE_KEY=${config.sops.placeholder."seafile/jwt_private_key"}
|
||||
NON_ROOT=false
|
||||
SEAHUB_SERVICE_URL=http://${rootCfg.server.name}
|
||||
SEAHUB_SERVICE_URL=http://${moduleCfg.server.name}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.seafile;
|
||||
cfg = rootCfg.seadoc;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.seafile;
|
||||
cfg = moduleCfg.seadoc;
|
||||
hostDataPath = "${common.dataDir}/seafile";
|
||||
in
|
||||
{
|
||||
@@ -18,7 +19,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
image = "docker.io/seafileltd/sdoc-server:2.0-latest";
|
||||
ports = [
|
||||
@@ -38,10 +39,10 @@ in
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
requires = [ "${common.backend}-${rootCfg.mariadb.name}.service" ];
|
||||
after = [ "${common.backend}-${rootCfg.mariadb.name}.service" ];
|
||||
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
requires = [ "${common.backend}-${moduleCfg.mariadb.name}.service" ];
|
||||
after = [ "${common.backend}-${moduleCfg.mariadb.name}.service" ];
|
||||
preStart = ''
|
||||
mkdir -p ${hostDataPath}/seadoc/shared
|
||||
'';
|
||||
|
||||
Reference in new issue
Block a user