nixos/modules/system/services/ollama.nix
Florian RICHER a425abee8b
All checks were successful
check / check (push) Successful in 32s
Refactor: Avoid use folder for one file
Fix #3
2025-01-29 21:48:43 +01:00

21 lines
442 B
Nix

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