infrastructure/machines/web01/static/default.nix

32 lines
589 B
Nix

{
lib,
pkgs,
sources,
...
}:
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";
"simi.normalesup.eu" = {
enableACME = true;
forceSSL = true;
root = (import sources.simiweb { inherit pkgs; }).site;
};
};
}