Add config for frps subdomains

This commit is contained in:
Eli Ribble 2025-10-14 03:45:43 +00:00
parent 8eee817ef6
commit 4e68e938ef
2 changed files with 18 additions and 1 deletions

View file

@ -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}";

View file

@ -1,4 +1,7 @@
{ config, lib, pkgs, ... }: {
myModules.caddy.enable = true;
myModules.frps.enable = true;
myModules.frps = {
enable = true;
subdomains = ["plex"];
};
}