nixos/modules/system/server/ollama/default.nix
Florian RICHER 4de2c3203f
Some checks failed
check / check (push) Failing after 0s
modules: Remove unused imports
2024-10-28 21:26:34 +01:00

21 lines
438 B
Nix

{ config, 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 nvidiaEnabled then "cuda" else null;
};
};
}