nixcfg/nixosModules/services/ollama/default.nix

20 lines
403 B
Nix
Raw Normal View History

2024-04-23 21:24:05 -04:00
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.ar.services.ollama.enable {
2024-04-23 21:24:05 -04:00
services.ollama = {
enable = true;
acceleration =
if config.ar.services.ollama.gpu == "amd"
2024-04-23 21:24:05 -04:00
then "rocm"
else if config.ar.services.ollama.gpu == "nvidia"
2024-04-23 21:24:05 -04:00
then "cuda"
else null;
listenAddress = config.ar.services.ollama.listenAddress;
2024-04-23 21:24:05 -04:00
};
};
}