2023-12-18 23:16:07 +01:00
|
|
|
{ sources, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
retired_host = "retired.dgnum.eu";
|
|
|
|
|
2023-12-21 15:08:12 +01:00
|
|
|
mkRetired = hosts:
|
|
|
|
builtins.listToAttrs (builtins.map (name: {
|
|
|
|
inherit name;
|
|
|
|
value.to = retired_host;
|
|
|
|
}) hosts);
|
|
|
|
|
|
|
|
mkSub = domain: builtins.map (s: "${s}.${domain}");
|
2023-12-21 15:11:33 +01:00
|
|
|
mkSubs = attrs:
|
|
|
|
builtins.concatLists (builtins.attrValues (builtins.mapAttrs mkSub attrs));
|
2023-12-21 15:08:12 +01:00
|
|
|
|
2023-12-18 23:16:07 +01:00
|
|
|
redirections = {
|
2023-12-19 18:38:57 +01:00
|
|
|
"nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu";
|
|
|
|
"notion.rz.ens.wtf".to = "docs.dgnum.eu";
|
|
|
|
"docs.beta.rz.ens.wtf".to = "pads.dgnum.eu";
|
2023-12-21 15:08:12 +01:00
|
|
|
"calendrier.eleves.ens.fr".to = "calendrier.dgnum.eu";
|
|
|
|
"git.rz.ens.wtf".to = "git.dgnum.eu";
|
|
|
|
} // (mkRetired retired);
|
2023-12-18 23:16:07 +01:00
|
|
|
|
2023-12-21 15:11:33 +01:00
|
|
|
retired = mkSubs {
|
|
|
|
"ens.fr" = [ "alevins" "www.climatenavigator" ];
|
2023-12-22 06:56:25 +01:00
|
|
|
"ens.wtf" = [ "photos" ];
|
2023-12-21 15:11:33 +01:00
|
|
|
"rz.ens.wtf" = [ "s3" "cdn" ];
|
|
|
|
"beta.rz.ens.wtf" = [
|
2023-12-21 15:08:12 +01:00
|
|
|
"todo"
|
|
|
|
"minecraft"
|
|
|
|
"factorio"
|
|
|
|
"home"
|
|
|
|
"pads"
|
|
|
|
"api.pads"
|
|
|
|
"files.pads"
|
|
|
|
"sandbox.pads"
|
|
|
|
"jurisprudens"
|
|
|
|
"rstudio"
|
2023-12-21 15:11:33 +01:00
|
|
|
];
|
|
|
|
};
|
2023-12-18 23:16:07 +01:00
|
|
|
|
|
|
|
in {
|
|
|
|
services.nginx.virtualHosts = {
|
2023-12-18 23:39:40 +01:00
|
|
|
${retired_host} = {
|
2023-12-18 23:16:07 +01:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
root = "${sources.dgnum-retired.outPath}/www";
|
2023-12-20 15:02:08 +01:00
|
|
|
|
|
|
|
default = true;
|
2023-12-18 23:16:07 +01:00
|
|
|
};
|
2023-12-19 18:38:57 +01:00
|
|
|
} // (builtins.mapAttrs (host:
|
2023-12-21 15:08:12 +01:00
|
|
|
{ to, ssl ? true }: {
|
2023-12-19 18:38:57 +01:00
|
|
|
globalRedirect = to;
|
|
|
|
enableACME = ssl;
|
|
|
|
forceSSL = ssl;
|
|
|
|
}) redirections);
|
2023-12-18 23:16:07 +01:00
|
|
|
}
|