nixos/oauth2-proxy: fix invalid comparison between list and attrset

oddlama 58286e51 f1010e04

Changed files
+3 -3
nixos
modules
services
+3 -3
nixos/modules/services/security/oauth2-proxy-nginx.nix
···
};
};
-
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;
···
'';
};
}
-
] ++ lib.optional (cfg.virtualHosts != []) {
+
] ++ lib.optional (cfg.virtualHosts != {}) {
recommendedProxySettings = true; # needed because duplicate headers
} ++ (lib.mapAttrsToList (vhost: conf: {
virtualHosts.${vhost} = {