From 5de459c347b260b8403be859bd110472bd89e8e5 Mon Sep 17 00:00:00 2001 From: soraefir Date: Fri, 8 May 2026 21:01:46 +0200 Subject: [PATCH] fix nulls --- modules/server/containers/builder.nix | 8 ++++---- modules/server/containers/defs/authentik.nix | 2 +- modules/server/containers/defs/nextcloud.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/server/containers/builder.nix b/modules/server/containers/builder.nix index a516ce1..c689b85 100644 --- a/modules/server/containers/builder.nix +++ b/modules/server/containers/builder.nix @@ -9,15 +9,15 @@ let let base = { inherit image; - environmentFiles = if secret then [ config.sops.secrets."${lib.toUpper secret}".path ] else []; + environmentFiles = if secret!=null then [ config.sops.secrets."${lib.toUpper secret}".path ] else []; environment = {} // extraEnv; - labels = if subdomain then ({ + labels = if subdomain!=null then ({ "traefik.enable" = "true"; "traefik.http.routers.${subdomain}.entrypoints" = "web-secure"; "traefik.http.routers.${subdomain}.rule" = "Host(`${subdomain}.${serverCfg.hostDomain}`)"; "traefik.http.routers.${subdomain}.tls" = "true"; - } // lib.optionalAttrs (port) { + } // lib.optionalAttrs (port!=null) { "traefik.http.services.${subdomain}.loadbalancer.server.port" = toString port; }) else { "traefik.enable" = "false"; @@ -25,7 +25,7 @@ let extraOptions = extraOptions ++ [ "--add-host=host.containers.internal:host-gateway" - ] ++ lib.optional (ip) "--ip=${ip}"; + ] ++ lib.optional (ip!=null) "--ip=${ip}"; }; in lib.recursiveUpdate base overrides; in { diff --git a/modules/server/containers/defs/authentik.nix b/modules/server/containers/defs/authentik.nix index ecc3a4a..0811c64 100644 --- a/modules/server/containers/defs/authentik.nix +++ b/modules/server/containers/defs/authentik.nix @@ -37,7 +37,7 @@ in { }; overrides = { cmd = [ "server" ]; - ports = if containerCfg.pubPort && containerCfg.port then [ "${toString containerCfg.pubPort}:${toString containerCfg.port}" ] else []; + ports = if containerCfg.pubPort!=null && containerCfg.port!=null then [ "${toString containerCfg.pubPort}:${toString containerCfg.port}" ] else []; volumes = [ "${serverCfg.configPath}/authentik/media:/media" "${serverCfg.configPath}/authentik/templates:/templates" diff --git a/modules/server/containers/defs/nextcloud.nix b/modules/server/containers/defs/nextcloud.nix index ae1a117..84ccd9d 100644 --- a/modules/server/containers/defs/nextcloud.nix +++ b/modules/server/containers/defs/nextcloud.nix @@ -47,7 +47,7 @@ in { "--tmpfs /tmp:rw,mode=1777" ]; overrides = { - ports = if containerCfg.pubPort && containerCfg.port then [ "${toString containerCfg.pubPort}:${toString containerCfg.port}" ] else []; + ports = if containerCfg.pubPort!=null && containerCfg.port!=null then [ "${toString containerCfg.pubPort}:${toString containerCfg.port}" ] else []; volumes = [ "${serverCfg.dataPath}/nextcloud/www:/var/www/html" "${serverCfg.dataPath}/nextcloud/data:/var/www/html/data"