diff options
author | Artturi <Artturin@artturin.com> | 2023-04-20 16:07:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-20 16:07:30 +0300 |
commit | b83db86a9e9ff5b07360e8917c3e007001b06f9c (patch) | |
tree | 01bc1eeb7fd3e6c17a4d3649400d8310ce691c59 /nixos/modules/services/security | |
parent | 2fc54db033c27ffb4f50e35a2079233d7280c9b9 (diff) | |
parent | 327b0cff7aedc20a148d245b1182f43800acc1f5 (diff) | |
download | nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.gz nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.bz2 nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.lz nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.xz nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.zst nixlib-b83db86a9e9ff5b07360e8917c3e007001b06f9c.zip |
Merge pull request #222080 from Stunkymonkey/nixos-optionalString
Diffstat (limited to 'nixos/modules/services/security')
-rw-r--r-- | nixos/modules/services/security/oauth2_proxy.nix | 5 |
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 |