1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-07 17:41:03 +01:00

ollama: add module (#5735)

This commit is contained in:
Terje Larsen 2025-01-10 12:31:03 +01:00 committed by GitHub
parent d4aebb947a
commit 2532b500c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 138 additions and 0 deletions

View file

@ -270,6 +270,7 @@ in import nmtSrc {
./modules/services/mpd-mpris
./modules/services/mpdris2
./modules/services/nix-gc
./modules/services/ollama
./modules/services/osmscout-server
./modules/services/pantalaimon
./modules/services/parcellite

View file

@ -0,0 +1,13 @@
{
config = {
services.ollama.enable = true;
test.stubs.ollama = { };
nmt.script = ''
serviceFile="home-files/.config/systemd/user/ollama.service"
assertFileRegex "$serviceFile" 'After=network\.target'
assertFileRegex "$serviceFile" 'Environment=OLLAMA_HOST=127.0.0.1:11434'
'';
};
}

View file

@ -0,0 +1,4 @@
{
ollama-basic = ./basic.nix;
ollama-set-environment-variables = ./set-environment-variables.nix;
}

View file

@ -0,0 +1,22 @@
{
config = {
services.ollama = {
enable = true;
host = "localhost";
port = 11111;
environmentVariables = {
OLLAMA_LLM_LIBRARY = "cpu";
HIP_VISIBLE_DEVICES = "0,1";
};
};
test.stubs.ollama = { };
nmt.script = ''
serviceFile="home-files/.config/systemd/user/ollama.service"
assertFileRegex "$serviceFile" 'Environment=OLLAMA_HOST=localhost:11111'
assertFileRegex "$serviceFile" 'Environment=OLLAMA_LLM_LIBRARY=cpu'
assertFileRegex "$serviceFile" 'Environment=HIP_VISIBLE_DEVICES=0,1'
'';
};
}