Install ollama (support for cuda)
All checks were successful
check / check (push) Successful in 33s

This commit is contained in:
Florian RICHER 2024-05-29 10:17:45 +02:00
parent f5407927cf
commit 3bc86778ff
3 changed files with 26 additions and 0 deletions

View file

@ -47,5 +47,9 @@
printing.enable = true;
waydroid.enable = true;
};
server = {
ollama.enable = true;
};
};
}

View file

@ -3,6 +3,7 @@
{
imports = [
./docker
./ollama
./openssh
];
}

View file

@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.server.ollama;
nvidiaEnabled = config.modules.system.hardware.nvidia.enable;
in
{
options.modules.system.server.ollama = {
enable = mkEnableOption ''
Enable ollama with my custom configurations
'';
};
config = mkIf cfg.enable {
services.ollama = {
enable = true;
acceleration = if config.modules.system.hardware.nvidia.enable then "cuda" else null;
};
};
}