Refactor
This commit is contained in:
@@ -13,52 +13,47 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
routerName = if containerCfg.subpath != null
|
||||
then "${containerCfg.subdomain}-${lib.strings.sanitizeDerivationName containerCfg.subpath}"
|
||||
else containerCfg.subdomain;
|
||||
in {
|
||||
paths = [{
|
||||
path = "${serverCfg.path.config}/transmission";
|
||||
owner = "1000:1000";
|
||||
mode = "0755";
|
||||
}];
|
||||
runtime = {
|
||||
paths = [{
|
||||
path = "${serverCfg.path.config}/transmission";
|
||||
owner = "1000:1000";
|
||||
mode = "0755";
|
||||
}];
|
||||
|
||||
containers = {
|
||||
server = builder.mkContainer {
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = containerCfg.subpath;
|
||||
imageStream = image;
|
||||
port = 9091;
|
||||
|
||||
extraEnv = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
WHITELIST = "";# 127.0.0.1,::1,10.*";
|
||||
# HOST_WHITELIST = "traefik-server,authentik-server,authentik-worker";
|
||||
};
|
||||
extraLabels = {
|
||||
} // (if serverCfg.containers ? authentik then {
|
||||
"traefik.http.routers.${routerName}.middlewares" = "authentik";
|
||||
} else {});
|
||||
containers = {
|
||||
server = builder.mkContainer {
|
||||
authentik = true;
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = containerCfg.subpath;
|
||||
imageStream = image;
|
||||
port = 9091;
|
||||
|
||||
extraEnv = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
WHITELIST = "";# 127.0.0.1,::1,10.*";
|
||||
# HOST_WHITELIST = "traefik-server,authentik-server,authentik-worker";
|
||||
};
|
||||
|
||||
overrides = {
|
||||
volumes = [
|
||||
"${serverCfg.path.dlComplete}:/downloads/complete"
|
||||
"${serverCfg.path.dlIncomplete}:/downloads/incomplete"
|
||||
"${serverCfg.path.config}/transmission:/config"
|
||||
];
|
||||
overrides = {
|
||||
volumes = [
|
||||
"${serverCfg.path.dlComplete}:/downloads/complete"
|
||||
"${serverCfg.path.dlIncomplete}:/downloads/incomplete"
|
||||
"${serverCfg.path.config}/transmission:/config"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
setup = {
|
||||
trigger = "server";
|
||||
envFile = [ config.sops.secrets."CUSTOM".path ];
|
||||
script = pkgs.writeShellScript "setup" ''
|
||||
|
||||
${pkgs.gettext}/bin/envsubst < "${../data/transmission/settings.json}" > "${serverCfg.path.config}/transmission/config/settings.json"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
setup = {
|
||||
trigger = "server";
|
||||
envFile = [ config.sops.secrets."CUSTOM".path ];
|
||||
script = pkgs.writeShellScript "setup" ''
|
||||
|
||||
${pkgs.gettext}/bin/envsubst < "${../data/transmission/settings.json}" > "${serverCfg.path.config}/transmission/config/settings.json"
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user