mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-10 02:36:54 +00:00
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
18 lines
509 B
Nix
18 lines
509 B
Nix
{
|
|
services.ollama = {
|
|
enable = true;
|
|
host = "localhost";
|
|
port = 11111;
|
|
environmentVariables = {
|
|
OLLAMA_LLM_LIBRARY = "cpu";
|
|
HIP_VISIBLE_DEVICES = "0,1";
|
|
};
|
|
};
|
|
|
|
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'
|
|
'';
|
|
}
|