summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/security/oauth2_proxy.nix
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-03-19 21:44:31 +0100
committerFelix Buehler <account@buehler.rocks>2023-04-07 13:38:33 +0200
commit327b0cff7aedc20a148d245b1182f43800acc1f5 (patch)
treea498ae1b2dd2289310483d81345903d7e9123cb7 /nixos/modules/services/security/oauth2_proxy.nix
parentb392d9b827cf4bb52141ab86e4202ec340f0b181 (diff)
treewide: use more lib.optionalString
Diffstat (limited to 'nixos/modules/services/security/oauth2_proxy.nix')
-rw-r--r--nixos/modules/services/security/oauth2_proxy.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/nixos/modules/services/security/oauth2_proxy.nix b/nixos/modules/services/security/oauth2_proxy.nix
index e3f8e75ca247..12547acabfe0 100644
--- a/nixos/modules/services/security/oauth2_proxy.nix
+++ b/nixos/modules/services/security/oauth2_proxy.nix
@@ -72,15 +72,14 @@ let
} // (getProviderOptions cfg cfg.provider) // cfg.extraConfig;
mapConfig = key: attr:
- if attr != null && attr != [] then (
+ optionalString (attr != null && attr != []) (
if isDerivation attr then mapConfig key (toString attr) else
if (builtins.typeOf attr) == "set" then concatStringsSep " "
(mapAttrsToList (name: value: mapConfig (key + "-" + name) value) attr) else
if (builtins.typeOf attr) == "list" then concatMapStringsSep " " (mapConfig key) attr else
if (builtins.typeOf attr) == "bool" then "--${key}=${boolToString attr}" else
if (builtins.typeOf attr) == "string" then "--${key}='${attr}'" else
- "--${key}=${toString attr}")
- else "";
+ "--${key}=${toString attr}");
configString = concatStringsSep " " (mapAttrsToList mapConfig allConfig);
in