From bc24082c6f3a8e0b314d338d42b2bf76073fd5f7 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 20 Jul 2024 15:22:03 -0600 Subject: sys/web: add support for multiple sites --- sys/web/sites/portal.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sys/web/sites/portal.nix (limited to 'sys/web/sites/portal.nix') diff --git a/sys/web/sites/portal.nix b/sys/web/sites/portal.nix new file mode 100644 index 0000000..e46a9b1 --- /dev/null +++ b/sys/web/sites/portal.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +with lib; let + cfg = config.local.web.sites.portal; + inherit (config.local) domains; +in +{ + options.local.web.sites.portal = { + enable = mkEnableOption "public non-fqdn portal"; + }; + + config = mkIf cfg.enable { + local.web = { + enable = mkDefault true; + ownedCerts = [ "host" ]; + }; + + services.nginx.virtualHosts.${domains.host.www} = { + forceSSL = true; + useACMEHost = domains.host.main; + serverAliases = [ domains.host.main ]; + }; + }; +} -- cgit v1.2.3