2024-10-28 21:26:34 +01:00
|
|
|
{ config, lib, ... }:
|
2024-05-29 10:17:45 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2024-05-29 10:46:26 +02:00
|
|
|
acceleration = if nvidiaEnabled then "cuda" else null;
|
2024-05-29 10:17:45 +02:00
|
|
|
};
|
|
|
|
};
|
2024-06-29 11:05:38 +02:00
|
|
|
}
|