infrastructure/machines/nixos/web01/static/default.nix

28 lines
595 B
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
2024-03-16 16:17:02 +01:00
{ lib, ... }:
let
inherit (lib) recursiveUpdate;
websites = import ./npins;
mkVhost =
2024-02-02 10:55:35 +01:00
_:
{ outPath, ... }:
{
2024-01-06 10:28:02 +01:00
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";
};
}