feat(static): Refactor www-eleves config
All checks were successful
build configuration / build_vault01 (push) Successful in 51s
build configuration / build_storage01 (push) Successful in 52s
build configuration / build_web02 (push) Successful in 1m0s
build configuration / build_web01 (push) Successful in 1m9s
build configuration / build_compute01 (push) Successful in 1m14s
ds-fr update / npins_update (push) Successful in 1m50s
npins update / npins_update (push) Successful in 1m8s

This commit is contained in:
Tom Hubrecht 2024-01-25 17:19:16 +01:00
parent 4359447596
commit 95fd21c378
5 changed files with 23 additions and 34 deletions

View file

@ -1,13 +1,21 @@
_:
{ lib, ... }:
let
inherit (lib) recursiveUpdate;
websites = import ./npins;
mkVhost = name:
{ outPath, ... }: {
mkVhost =
name:
{ outPath, ... }:
{
enableACME = true;
forceSSL = true;
root = "${outPath}/www";
};
in
in { services.nginx.virtualHosts = builtins.mapAttrs mkVhost websites; }
{
services.nginx.virtualHosts = recursiveUpdate (builtins.mapAttrs mkVhost websites) {
"eleves.dgnum.eu".locations."/".tryFiles = "$uri $uri/index.html /fr/$uri /en/$uri /fr/index.html";
};
}