From df033fb84d8e5278639d681ebc025e90e50436c3 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 21 Dec 2023 15:11:33 +0100 Subject: [PATCH] feat(redirections): simplify retired services management --- machines/web01/redirections.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/machines/web01/redirections.nix b/machines/web01/redirections.nix index f37d8d3..9865dbe 100644 --- a/machines/web01/redirections.nix +++ b/machines/web01/redirections.nix @@ -10,6 +10,8 @@ let }) hosts); mkSub = domain: builtins.map (s: "${s}.${domain}"); + mkSubs = attrs: + builtins.concatLists (builtins.attrValues (builtins.mapAttrs mkSub attrs)); redirections = { "nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu"; @@ -19,8 +21,10 @@ let "git.rz.ens.wtf".to = "git.dgnum.eu"; } // (mkRetired retired); - retired = (mkSub "ens.fr" [ "alevins" "www.climatenavigator" ]) - ++ (mkSub "rz.ens.wtf" [ "s3" "cdn" ]) ++ (mkSub "beta.rz.ens.wtf" [ + retired = mkSubs { + "ens.fr" = [ "alevins" "www.climatenavigator" ]; + "rz.ens.wtf" = [ "s3" "cdn" ]; + "beta.rz.ens.wtf" = [ "todo" "minecraft" "factorio" @@ -31,7 +35,8 @@ let "sandbox.pads" "jurisprudens" "rstudio" - ]); + ]; + }; in { services.nginx.virtualHosts = {