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
@@ -6,8 +6,8 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
cfg = config.selfhosted;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -299,7 +299,8 @@ in
|
||||
targetName = "mail";
|
||||
hostPorts =
|
||||
let
|
||||
cfg = config.selfhosted.mail.stalwart;
|
||||
moduleCfg = rootCfg.mail;
|
||||
cfg = moduleCfg.stalwart;
|
||||
in
|
||||
[
|
||||
cfg.hostImapsPort
|
||||
@@ -348,15 +349,15 @@ in
|
||||
};
|
||||
|
||||
virtualisation = lib.mkMerge [
|
||||
{ oci-containers.backend = config.selfhosted.common.backend; }
|
||||
{ oci-containers.backend = rootCfg.common.backend; }
|
||||
(
|
||||
if config.selfhosted.common.backend == "docker" then
|
||||
if rootCfg.common.backend == "docker" then
|
||||
{
|
||||
docker = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
else if config.selfhosted.common.backend == "podman" then
|
||||
else if rootCfg.common.backend == "podman" then
|
||||
{
|
||||
podman = {
|
||||
enable = true;
|
||||
@@ -386,7 +387,7 @@ in
|
||||
};
|
||||
|
||||
sops.templates."netbird-homelab.env".content = ''
|
||||
NB_MANAGEMENT_URL=https://${cfg.netbird.subdomain}.${config.sops.placeholder."domains/serv"}
|
||||
NB_MANAGEMENT_URL=https://${rootCfg.netbird.subdomain}.${config.sops.placeholder."domains/serv"}
|
||||
'';
|
||||
|
||||
systemd.services = {
|
||||
@@ -428,16 +429,16 @@ in
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [
|
||||
"${common.backend}-network-${common.network.name}.service" # wait for network creation
|
||||
"${common.backend}-${config.selfhosted.netbird.traefik.name}.service"
|
||||
"${common.backend}-${rootCfg.netbird.traefik.name}.service"
|
||||
];
|
||||
after = [
|
||||
"${common.backend}-network-${common.network.name}.service"
|
||||
"${common.backend}-${config.selfhosted.netbird.traefik.name}.service"
|
||||
"${common.backend}-${rootCfg.netbird.traefik.name}.service"
|
||||
];
|
||||
};
|
||||
|
||||
networking.firewall.interfaces = lib.mkMerge [
|
||||
(lib.mkIf (config.selfhosted.common.backend == "podman") (
|
||||
(lib.mkIf (rootCfg.common.backend == "podman") (
|
||||
let
|
||||
matchAll = if !config.networking.nftables.enable then "podman+" else "podman*";
|
||||
in
|
||||
|
||||
Reference in new issue
Block a user