2025-06-04 19:08:12 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
2025-07-27 22:50:25 +02:00
|
|
|
cfg = config.home.dev.ollama;
|
2025-06-04 19:08:12 +02:00
|
|
|
in {
|
2025-07-27 22:50:25 +02:00
|
|
|
options.home.dev.ollama = {
|
2025-06-04 19:08:12 +02:00
|
|
|
enable = mkEnableOption "Enables Ollama";
|
|
|
|
gpu = mkOption {
|
|
|
|
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
|
|
|
example = "amd";
|
|
|
|
default = "none";
|
|
|
|
description = "Which type of GPU should be used for hardware acceleration";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config.services.ollama = mkIf cfg.enable {
|
|
|
|
inherit (cfg) enable;
|
|
|
|
environmentVariables = {
|
|
|
|
OLLAMA_CONTEXT_LENGTH = "8192";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|