From 3caf5079052d398b49e3547264a294f74ace00ef Mon Sep 17 00:00:00 2001 From: soraefir Date: Wed, 6 May 2026 23:35:03 +0200 Subject: [PATCH] Fix attempt --- modules/server/containers/builder.nix | 50 ++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/modules/server/containers/builder.nix b/modules/server/containers/builder.nix index b7de7a2..8c4d5c7 100644 --- a/modules/server/containers/builder.nix +++ b/modules/server/containers/builder.nix @@ -1,28 +1,30 @@ { config, lib, serverCfg }: -{ image, secret ? "" -, subdomain ? "", ip ? "", port ? 0 -, extraEnv ? { }, extraLabels ? { } -, overrides ? { } -}: -let base = { - inherit image; +let builder = + { image, secret ? "" + , subdomain ? "", ip ? "", port ? 0 + , extraEnv ? { }, extraLabels ? { } + , overrides ? { } + }: + let base = { + inherit image; - environmentFiles = if secret !="" then [ config.sops.secrets."${lib.toUpper secret}".path ] else []; - environment = {} // extraEnv; + environmentFiles = if secret !="" then [ config.sops.secrets."${lib.toUpper secret}".path ] else []; + environment = {} // extraEnv; - labels = if subdomain!="" 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 != 0) { - "traefik.http.services.${subdomain}.loadbalancer.server.port" = toString port; - }) else { - "traefik.enable" = "false"; - } // extraLabels; + labels = if subdomain!="" 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 != 0) { + "traefik.http.services.${subdomain}.loadbalancer.server.port" = toString port; + }) else { + "traefik.enable" = "false"; + } // extraLabels; - extraOptions = [ - "--add-host=host.containers.internal:host-gateway" - ] ++ lib.optional (ip != "") "--ip=${ip}"; -}; -in lib.recursiveUpdate base overrides // { host = "host.containers.internal"; } \ No newline at end of file + extraOptions = [ + "--add-host=host.containers.internal:host-gateway" + ] ++ lib.optional (ip != "") "--ip=${ip}"; + }; + in lib.recursiveUpdate base overrides; +in builder // { host = "host.containers.internal"; } \ No newline at end of file