{ config, pkgs, lib, ... }: let mkDomain = subname: "${subname}.${config.networking.fqdn}"; in { _module.args.mkDomain = mkDomain; _module.args.allSubdomains = lib.pipe config.services.nginx.virtualHosts [ #(lib.mapAttrsToList (domain: vhost: [ domain ] ++ vhost.serverAliases)) (lib.mapAttrsToList (domain: vhost: [ domain ])) lib.flatten (builtins.filter (domain: domain != "" && domain != "_")) (lib.sort (x: y: x no ''; }; /**/ # Website tunnel # TODO: remove /** / services.nginx.virtualHosts.${config.networking.fqdn} = { forceSSL = true; # addSSL = true; enableACME = true; #acmeRoot = null; # use DNS default = true; serverAliases = map mkDomain [ "www" #"*" # requires DNS ACME ]; # The alternative to ^ is: config.security.acme.certs."${acmeDomain}".extraDomainNames = [ (mkDomain "foo") ]; # TODO: 'nox' alias for everything locations."/" = { proxyPass = "http://pbuntu.pbsds.net"; proxyWebsockets = true; }; }; #services.nginx.virtualHosts.${mkDomain "www"} = { # addSSL = true; # useACMEHost = acmeDomain; #enableACME = true; # locations."/" = { # proxyPass = "http://pbuntu.pbsds.net"; # proxyWebsockets = true; # }; #}; /**/ }