Skip to content

Commit 8d956b1

Browse files
committed
nixos/ollama: Add listenAddress
1 parent 8b397b2 commit 8d956b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nixos/modules/services/misc/ollama.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ in {
99
enable = lib.mkEnableOption (
1010
lib.mdDoc "Server for local large language models"
1111
);
12+
listenAddress = lib.mkOption {
13+
type = lib.types.str;
14+
default = "127.0.0.1:11434";
15+
description = lib.mdDoc ''
16+
Specifies the bind address on which the ollama server HTTP interface listens.
17+
'';
18+
};
1219
package = lib.mkPackageOption pkgs "ollama" { };
1320
};
1421
};
@@ -23,6 +30,7 @@ in {
2330
environment = {
2431
HOME = "%S/ollama";
2532
OLLAMA_MODELS = "%S/ollama/models";
33+
OLLAMA_HOST = cfg.listenAddress;
2634
};
2735
serviceConfig = {
2836
ExecStart = "${lib.getExe cfg.package} serve";

0 commit comments

Comments
 (0)