{ config, pkgs, lib, ... }: let inherit (config.pbsds.nginx) mkDomain allSubdomains; in { options.pbsds.nginx.mkDomain = lib.mkOption { visible = false; internal = true; readOnly = true; default = subname: "${subname}.${config.networking.fqdn}"; }; options.pbsds.nginx.allSubdomains = lib.mkOption { visible = false; internal = true; readOnly = true; default = lib.pipe config.services.nginx.virtualHosts [ # #(lib.mapAttrsToList (domain: vhost: [ domain ] ++ vhost.serverAliases)) # (lib.mapAttrsToList (domain: vhost: [ domain ])) # lib.flatten lib.attrNames (lib.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; # }; #}; /**/ }; }