commit a608dd92e89d2bf52c462fa4ae93681d00c9c1e6 parent 6e8863122f2fe2dfb3a41b6bb79c07c409330c2c Author: mtmn <miro@haravara.org> Date: Sun, 21 Jun 2026 16:30:00 +0200 redlib: add tailnet support Diffstat:
| M | hosts/nixaran/configuration.nix | | | 0 | |
| M | modules/services/redlib.nix | | | 22 | ++++++++++++++++------ |
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/hosts/nixaran/configuration.nix b/hosts/nixaran/configuration.nix Binary files differ. diff --git a/modules/services/redlib.nix b/modules/services/redlib.nix @@ -11,11 +11,13 @@ in { port = lib.mkOption { type = lib.types.port; default = 7828; - description = "Port to expose Redlib on"; }; domain = lib.mkOption { type = lib.types.str; - description = "Domain for the Redlib instance"; + }; + tailnetPort = lib.mkOption { + type = lib.types.nullOr lib.types.port; + default = null; }; authLabel = haravara.authLabelOption; }; @@ -34,9 +36,17 @@ in { }; }; - services.caddy.virtualHosts."${cfg.domain}".extraConfig = '' - ${haravara.mkAuthImport cfg.authLabel} - reverse_proxy 127.0.0.1:${toString cfg.port} - ''; + services.caddy.virtualHosts = + { + "${cfg.domain}".extraConfig = '' + ${haravara.mkAuthImport cfg.authLabel} + reverse_proxy 127.0.0.1:${toString cfg.port} + ''; + } + // lib.optionalAttrs (cfg.tailnetPort != null) { + ":${toString cfg.tailnetPort}".extraConfig = '' + reverse_proxy 127.0.0.1:${toString cfg.port} + ''; + }; }; }