forked from DGNum/infrastructure
23 lines
488 B
Nix
23 lines
488 B
Nix
{ lib, ... }:
|
|
|
|
let
|
|
inherit (lib) recursiveUpdate;
|
|
websites = import ./npins;
|
|
|
|
mkVhost =
|
|
_:
|
|
{ outPath, ... }:
|
|
{
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
root = "${outPath}/www";
|
|
};
|
|
in
|
|
|
|
{
|
|
services.nginx.virtualHosts = recursiveUpdate (builtins.mapAttrs mkVhost websites) {
|
|
"eleves.dgnum.eu".locations."/".tryFiles = "$uri $uri/index.html /fr/$uri /en/$uri /fr/index.html";
|
|
|
|
"retired.dgnum.eu".locations."/".tryFiles = "/index.html =404";
|
|
};
|
|
}
|