summaryrefslogtreecommitdiff
path: root/sys/web/sites
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2024-07-20 15:22:03 -0600
committerAlejandro Soto <alejandro@34project.org>2024-07-20 18:01:37 -0600
commitbc24082c6f3a8e0b314d338d42b2bf76073fd5f7 (patch)
tree2e9c037c7f1e0b6965c9ea1f560359bdeed5d3fe /sys/web/sites
parent2471ef3f39083538202a65375885869e54477ec2 (diff)
sys/web: add support for multiple sites
Diffstat (limited to 'sys/web/sites')
-rw-r--r--sys/web/sites/default.nix5
-rw-r--r--sys/web/sites/portal.nix23
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/web/sites/default.nix b/sys/web/sites/default.nix
new file mode 100644
index 0000000..b453d24
--- /dev/null
+++ b/sys/web/sites/default.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./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 ];
+ };
+ };
+}