about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMarcus Ramberg <marcus@means.no>2024-01-20 14:36:55 +0100
committerMarcus Ramberg <marcus@means.no>2024-01-21 00:27:07 +0100
commit8d956b1725be2b21116ba8e267c0f892e1d08a76 (patch)
tree08614c7da1e9b7acc33e68372d55f1bff776bc63 /nixos
parent8b397b2bfbf45b4d5a7ddfefe94050ce7e4a996d (diff)
nixos/ollama: Add listenAddress
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/ollama.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/ollama.nix b/nixos/modules/services/misc/ollama.nix
index 9794bbbec464c..d9359d2b5cd44 100644
--- a/nixos/modules/services/misc/ollama.nix
+++ b/nixos/modules/services/misc/ollama.nix
@@ -9,6 +9,13 @@ in {
       enable = lib.mkEnableOption (
         lib.mdDoc "Server for local large language models"
       );
+      listenAddress = lib.mkOption {
+        type = lib.types.str;
+        default = "127.0.0.1:11434";
+        description = lib.mdDoc ''
+          Specifies the bind address on which the ollama server HTTP interface listens.
+        '';
+      };
       package = lib.mkPackageOption pkgs "ollama" { };
     };
   };
@@ -23,6 +30,7 @@ in {
         environment = {
           HOME = "%S/ollama";
           OLLAMA_MODELS = "%S/ollama/models";
+          OLLAMA_HOST = cfg.listenAddress;
         };
         serviceConfig = {
           ExecStart = "${lib.getExe cfg.package} serve";