infrastructure/machines/web01/redirections.nix
2023-12-18 23:39:40 +01:00

26 lines
635 B
Nix

{ sources, ... }:
let
retired_host = "retired.dgnum.eu";
redirections = {
"nuage.beta.rz.ens.wtf" = "cloud.dgnum.eu";
"notion.rz.ens.wtf" = "docs.dgnum.eu";
"docs.beta.rz.ens.wtf" = "pads.dgnum.eu";
} // (builtins.listToAttrs (builtins.map (name: {
inherit name;
value = retired_host;
}) retired));
retired = [ "auth.rz.ens.wtf" "photos.ens.wtf" ];
in {
services.nginx.virtualHosts = {
${retired_host} = {
enableACME = true;
forceSSL = true;
root = "${sources.dgnum-retired.outPath}/www";
};
} // (builtins.mapAttrs (host: to: { globalRedirect = to; }) redirections);
}