From 4e68e938ef9e48b44e21c01513dfc5dbdc2c5c29 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 14 Oct 2025 03:45:43 +0000 Subject: [PATCH] Add config for frps subdomains --- modules/system/frps.nix | 14 ++++++++++++++ roles/sovr.nix | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/system/frps.nix b/modules/system/frps.nix index 2afeb94..d768102 100644 --- a/modules/system/frps.nix +++ b/modules/system/frps.nix @@ -1,11 +1,16 @@ { config, configFiles, inputs, lib, pkgs, ... }: with lib; let + cfg = config.myModules.frps; group = "frps"; user = "frps"; in { options.myModules.frps = { enable = mkEnableOption "custom frps configuration"; + subdomains = mkOption { + type = types.listOf types.str; + description = "All the subdomains to handle"; + }; }; config = mkIf config.myModules.frps.enable { environment = { @@ -15,6 +20,15 @@ in { ]; }; + services.caddy.virtualHosts = mkMerge ( + map (subdomain: { + "${subdomain}.sovr.cloud" = { + extraConfig = '' + reverse_proxy [::1]:8000 + ''; + }; + }) cfg.subdomains + ); sops.secrets.frps-env = { format = "dotenv"; group = "${group}"; diff --git a/roles/sovr.nix b/roles/sovr.nix index aae8cbe..b0f06f6 100644 --- a/roles/sovr.nix +++ b/roles/sovr.nix @@ -1,4 +1,7 @@ { config, lib, pkgs, ... }: { myModules.caddy.enable = true; - myModules.frps.enable = true; + myModules.frps = { + enable = true; + subdomains = ["plex"]; + }; }