2024-01-25 17:08:47 +01:00
|
|
|
_:
|
2023-12-18 23:16:07 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
retired_host = "retired.dgnum.eu";
|
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
mkRetired =
|
|
|
|
hosts:
|
|
|
|
builtins.listToAttrs (
|
2024-03-10 01:03:30 +01:00
|
|
|
builtins.map (name: {
|
|
|
|
inherit name;
|
|
|
|
value = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/".return = "301 https://${retired_host}/${name}";
|
|
|
|
};
|
|
|
|
}) hosts
|
2024-02-02 10:51:31 +01:00
|
|
|
);
|
2023-12-21 15:08:12 +01:00
|
|
|
|
|
|
|
mkSub = domain: builtins.map (s: "${s}.${domain}");
|
2024-02-02 10:51:31 +01:00
|
|
|
mkSubs = attrs: builtins.concatLists (builtins.attrValues (builtins.mapAttrs mkSub attrs));
|
2023-12-21 15:08:12 +01:00
|
|
|
|
2024-02-14 11:15:46 +01:00
|
|
|
mkRedirection =
|
|
|
|
_:
|
|
|
|
{ to }:
|
|
|
|
{
|
|
|
|
globalRedirect = to;
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
};
|
|
|
|
|
2023-12-18 23:16:07 +01:00
|
|
|
redirections = {
|
2023-12-21 15:08:12 +01:00
|
|
|
"calendrier.eleves.ens.fr".to = "calendrier.dgnum.eu";
|
2024-01-23 14:38:20 +01:00
|
|
|
"docs.beta.rz.ens.wtf".to = "pads.dgnum.eu";
|
2023-12-21 15:08:12 +01:00
|
|
|
"git.rz.ens.wtf".to = "git.dgnum.eu";
|
2024-01-23 14:38:20 +01:00
|
|
|
"notion.rz.ens.wtf".to = "docs.dgnum.eu";
|
|
|
|
"nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu";
|
|
|
|
"rdv.dgnum.eu".to = "meet.dgnum.eu";
|
2024-02-06 13:20:09 +01:00
|
|
|
"www.bda.ens.fr".to = "bda.ens.fr";
|
2024-02-06 13:23:17 +01:00
|
|
|
"bda.wp.dgnum.eu".to = "bda.ens.fr";
|
2024-02-14 11:15:46 +01:00
|
|
|
};
|
2023-12-18 23:16:07 +01:00
|
|
|
|
2023-12-21 15:11:33 +01:00
|
|
|
retired = mkSubs {
|
2024-02-02 10:51:31 +01:00
|
|
|
"ens.fr" = [
|
|
|
|
"alevins"
|
|
|
|
"www.climatenavigator"
|
|
|
|
];
|
2023-12-22 06:56:25 +01:00
|
|
|
"ens.wtf" = [ "photos" ];
|
2024-02-02 10:51:31 +01:00
|
|
|
"rz.ens.wtf" = [
|
|
|
|
"s3"
|
|
|
|
"cdn"
|
|
|
|
];
|
2023-12-21 15:11:33 +01:00
|
|
|
"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
|
|
|
];
|
|
|
|
};
|
2024-02-02 10:51:31 +01:00
|
|
|
in
|
|
|
|
{
|
2024-02-14 11:15:46 +01:00
|
|
|
services.nginx.virtualHosts = {
|
|
|
|
${retired_host}.default = true;
|
|
|
|
} // (builtins.mapAttrs mkRedirection redirections) // (mkRetired retired);
|
2023-12-18 23:16:07 +01:00
|
|
|
}
|