25 lines
502 B
Nix
25 lines
502 B
Nix
![]() |
{
|
||
|
config,
|
||
|
lib,
|
||
|
...
|
||
|
}:
|
||
|
with lib; let
|
||
|
cfg = config.extraServices.ollama;
|
||
|
in {
|
||
|
options.extraServices.ollama.enable = mkEnableOption "enable ollama";
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
services.ollama = {
|
||
|
enable = true;
|
||
|
acceleration =
|
||
|
if config.services.xserver.videoDrivers == ["amdgpu"]
|
||
|
then "rocm"
|
||
|
else if config.services.xserver.videoDrivers == ["nvidia"]
|
||
|
then "cuda"
|
||
|
else null;
|
||
|
host = "[::]";
|
||
|
openFirewall = true;
|
||
|
};
|
||
|
};
|
||
|
}
|