aboutsummaryrefslogtreecommitdiff
path: root/modules/services
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2025-01-27 21:58:58 -0500
committertdback <tyler@tdback.net>2025-01-27 21:58:58 -0500
commite12c880352775428bdaf890193cbbf6720a927f9 (patch)
treee36f9bed68e5f68eac828f2f0d365cb59e37b4b3 /modules/services
parent45d4162c338a3602b72de58ee3fe0880191f4406 (diff)
llm: change `networkRange` option to `subnet`
Diffstat (limited to 'modules/services')
-rw-r--r--modules/services/llm/default.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/services/llm/default.nix b/modules/services/llm/default.nix
index 0c97720..e2e08a9 100644
--- a/modules/services/llm/default.nix
+++ b/modules/services/llm/default.nix
@@ -15,10 +15,10 @@ in
type = types.int;
description = "Which port the Open-WebUI server listens to.";
};
- networkRange = mkOption {
+ subnet = mkOption {
default = null;
type = types.str;
- description = "The network range allowed to acccess Open-WebUI and the ollama API";
+ description = "The network subnet allowed to acccess Open-WebUI and the ollama API";
};
nvidiaGpu = mkOption {
default = false;
@@ -41,7 +41,7 @@ in
services.open-webui = {
enable = true;
- host = if cfg.networkRange == null then "127.0.0.1" else "0.0.0.0";
+ host = if cfg.subnet == null then "127.0.0.1" else "0.0.0.0";
port = cfg.port;
};
@@ -53,9 +53,9 @@ in
api = builtins.toString ollama.port;
web = builtins.toString open-webui.port;
in
- mkIf (cfg.networkRange != null) ''
- iptables -A nixos-fw -p tcp --source ${cfg.networkRange} --dport ${api}:${api} -j nixos-fw-accept
- iptables -A nixos-fw -p tcp --source ${cfg.networkRange} --dport ${web}:${web} -j nixos-fw-accept
+ mkIf (cfg.subnet != null) ''
+ iptables -A nixos-fw -p tcp --source ${cfg.subnet} --dport ${api}:${api} -j nixos-fw-accept
+ iptables -A nixos-fw -p tcp --source ${cfg.subnet} --dport ${web}:${web} -j nixos-fw-accept
'';
# Enable the proprietary NVIDIA drivers in a headless fashion.