diff --git a/machines/nixos/web03/django-apps/gestiocof.nix b/machines/nixos/web03/django-apps/gestiocof.nix index 005e364..e4643b1 100644 --- a/machines/nixos/web03/django-apps/gestiocof.nix +++ b/machines/nixos/web03/django-apps/gestiocof.nix @@ -2,7 +2,11 @@ # # SPDX-License-Identifier: EUPL-1.2 -{ config, ... }: +{ config, lib, ... }: + +let + inherit (lib) listToAttrs nameValuePair; +in { services.django-apps.sites.gestiocof = { @@ -14,10 +18,25 @@ enableACME = true; forceSSL = true; - locations."/ws/" = { - proxyPass = "http://unix:/run/django-apps/gestiocof/socket"; - proxyWebsockets = true; - }; + locations = + { + "/ws/" = { + proxyPass = "http://unix:/run/django-apps/gestiocof/socket"; + proxyWebsockets = true; + }; + } + // (listToAttrs ( + builtins.map (folder: nameValuePair "~ ^/${folder}/" { root = "/users/guests/cof/www/"; }) [ + "arcanoid" + "cirque" + "pompom" + "trouveres" + ] + )); + + extraConfig = '' + rewrite ^/$ /news; + ''; }; webHookSecret = config.age.secrets."webhook-gestiocof_token".path;