fix nulls
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user