Merge pull request #310350 from oddlama/fix-oauth2-proxy

nixos/oauth2-proxy: fix invalid comparison between list and attrset
This commit is contained in:
K900 2024-05-13 13:06:41 +03:00 committed by GitHub
commit 446ec6d9ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,11 +64,11 @@ in
};
};
config.services.oauth2-proxy = lib.mkIf (cfg.virtualHosts != [] && (lib.hasPrefix "127.0.0.1:" cfg.proxy)) {
config.services.oauth2-proxy = lib.mkIf (cfg.virtualHosts != {} && (lib.hasPrefix "127.0.0.1:" cfg.proxy)) {
enable = true;
};
config.services.nginx = lib.mkIf (cfg.virtualHosts != [] && config.services.oauth2-proxy.enable) (lib.mkMerge ([
config.services.nginx = lib.mkIf (cfg.virtualHosts != {} && config.services.oauth2-proxy.enable) (lib.mkMerge ([
{
virtualHosts.${cfg.domain}.locations."/oauth2/" = {
proxyPass = cfg.proxy;
@ -78,7 +78,7 @@ in
'';
};
}
] ++ lib.optional (cfg.virtualHosts != []) {
] ++ lib.optional (cfg.virtualHosts != {}) {
recommendedProxySettings = true; # needed because duplicate headers
} ++ (lib.mapAttrsToList (vhost: conf: {
virtualHosts.${vhost} = {