From ee115376696d32f0f6b7072ab6b8f250421c6c79 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Wed, 14 Aug 2024 21:28:39 +0200 Subject: [PATCH] gerd.authelia: added new shared function for protectedLocation --- machines/gerd/services/authelia/authelia-nginx.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/machines/gerd/services/authelia/authelia-nginx.nix b/machines/gerd/services/authelia/authelia-nginx.nix index 3b9f8c6..9fc08f8 100644 --- a/machines/gerd/services/authelia/authelia-nginx.nix +++ b/machines/gerd/services/authelia/authelia-nginx.nix @@ -78,6 +78,10 @@ let in { mine.shared.lib.authelia.mkProtectedWebsite = { vhostConfig, endpoint ? "/" }: lib.recursiveUpdate vhostConfig { extraConfig = (lib.attrByPath [ "extraConfig" ] "" vhostConfig) + "\n" + "include ${autheliaLocation};"; - locations."${endpoint}".extraConfig = (lib.attrByPath [ "locations" endpoint "extraConfig" ] "" vhostConfig) + "\n" + "include ${autheliaRequest};"; + locations."${endpoint}" = config.mine.shared.lib.authelia.mkProtectedLocation (lib.attrByPath [ "locations" endpoint ] {} vhostConfig); + }; + + mine.shared.lib.authelia.mkProtectedLocation = vhostLocationConfig: lib.recursiveUpdate vhostLocationConfig { + extraConfig = (lib.attrByPath [ "extraConfig" ] "" vhostLocationConfig) + "\n" + "include ${autheliaRequest};"; }; }