{ inputs, lib, libNginx, libPlausible, ... }: with lib; { nixfiles.modules.nginx = { enable = true; virtualHosts = with my.domain; { ${shire}.locations."/".return = "301 https://www.youtube.com/watch?v=dQw4w9WgXcQ"; "git.${shire}".locations."/".return = "301 https://git.${azahi}"; "bitwarden.${shire}".locations."/".return = "301 https://vaultwarden.${shire}"; ${azahi} = { serverAliases = [ "frodo.${gondor}" "frodo.${rohan}" ]; locations."/" = { root = inputs.azahi-cc; extraConfig = libNginx.config.appendHead [ (libPlausible.htmlPlausibleScript { domain = azahi; }) ]; }; }; } // ( let frodo = "301 https://frodo."; in { ${gondor}.locations."/".return = concatStrings [ frodo gondor ]; ${rohan}.locations."/".return = concatStrings [ frodo rohan ]; } ); }; }