nixos/modules/system/server/ollama/default.nix

22 lines
438 B
Nix
Raw Normal View History

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;
acceleration = if nvidiaEnabled then "cuda" else null;
2024-05-29 10:17:45 +02:00
};
};
2024-06-29 11:05:38 +02:00
}