Compare commits

3 Commits

Author SHA1 Message Date
Sovran_Systems
1ed7ab9776 Merge pull request #109 from naturallaw777/copilot/add-extra-virtual-hosts-option
[WIP] Add NixOS option for extra Caddy virtual hosts
2026-04-07 08:07:17 -05:00
copilot-swe-agent[bot]
dd8867b52f feat: add sovran_systemsOS.caddy.extraVirtualHosts NixOS option
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/e966dd20-b74e-4ec5-b4db-68aa06129162

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
2026-04-07 13:06:35 +00:00
copilot-swe-agent[bot]
3668eb2829 Initial plan 2026-04-07 13:02:55 +00:00
3 changed files with 31 additions and 0 deletions

View File

@@ -22,4 +22,20 @@
# ─── Add your custom NixOS configuration below ─────────── # ─── Add your custom NixOS configuration below ───────────
# ─── Custom Caddy virtual hosts ──────────────────────────
# Uncomment and edit below to add your own Caddy sites:
#
# sovran_systemsOS.caddy.extraVirtualHosts = ''
# mysite.example.com {
# encode gzip zstd
# root * /var/lib/www/mysite
# php_fastcgi unix//run/phpfpm/mypool.sock
# file_server browse
# }
#
# anotherdomain.com {
# reverse_proxy localhost:9090
# }
# '';
} }

View File

@@ -2,6 +2,7 @@
let let
exposeBtcpay = config.sovran_systemsOS.web.btcpayserver; exposeBtcpay = config.sovran_systemsOS.web.btcpayserver;
extraVhosts = config.sovran_systemsOS.caddy.extraVirtualHosts;
in in
{ {
services.caddy = { services.caddy = {
@@ -170,6 +171,11 @@ EOF
encode gzip zstd encode gzip zstd
} }
EOF EOF
# Custom vhosts from custom.nix
cat >> /run/caddy/Caddyfile <<'CUSTOM_VHOSTS_EOF'
${extraVhosts}
CUSTOM_VHOSTS_EOF
''; '';
}; };
} }

View File

@@ -60,6 +60,15 @@
}; };
}; };
# ── Caddy customisation ───────────────────────────────────
caddy = {
extraVirtualHosts = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Additional raw Caddyfile blocks appended to the generated Caddy config. Use this in custom.nix to add custom domains and reverse proxies.";
};
};
# ── Domain setup registry ───────────────────────────────── # ── Domain setup registry ─────────────────────────────────
domainRequirements = lib.mkOption { domainRequirements = lib.mkOption {
type = lib.types.listOf (lib.types.submodule { type = lib.types.listOf (lib.types.submodule {