services.ollama.environmentVariables

NixOS option

Set arbitrary environment variables for the ollama service. Be aware that these are only seen by the ollama server (systemd service), not normal invocations like ollama run. Since ollama run is mostly a shell around the ollama server, this is usually sufficient.

type: attribute set of string
Default
{ }
Example
{
  HIP_VISIBLE_DEVICES = "0,1";
  OLLAMA_LLM_LIBRARY = "cpu";
}
declared in: nixos/modules/services/misc/ollama.nixView source on NixOS/nixpkgs →