Merge pull request #310350 from oddlama/fix-oauth2-proxy
nixos/oauth2-proxy: fix invalid comparison between list and attrset
This commit is contained in:
commit
446ec6d9ab
@ -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;
|
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/" = {
|
virtualHosts.${cfg.domain}.locations."/oauth2/" = {
|
||||||
proxyPass = cfg.proxy;
|
proxyPass = cfg.proxy;
|
||||||
@ -78,7 +78,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
] ++ lib.optional (cfg.virtualHosts != []) {
|
] ++ lib.optional (cfg.virtualHosts != {}) {
|
||||||
recommendedProxySettings = true; # needed because duplicate headers
|
recommendedProxySettings = true; # needed because duplicate headers
|
||||||
} ++ (lib.mapAttrsToList (vhost: conf: {
|
} ++ (lib.mapAttrsToList (vhost: conf: {
|
||||||
virtualHosts.${vhost} = {
|
virtualHosts.${vhost} = {
|
||||||
|
Loading…
Reference in New Issue
Block a user