34 lines
843 B
Nix
Raw Permalink Normal View History

2024-10-20 00:30:58 +02:00
{
config,
lib,
2025-01-28 09:57:26 +01:00
pkgs,
2024-10-20 00:30:58 +02:00
...
}:
with lib; let
cfg = config.extraServices.ollama;
in {
options.extraServices.ollama.enable = mkEnableOption "enable ollama";
config = mkIf cfg.enable {
services.ollama = {
enable = true;
2025-01-28 09:57:26 +01:00
package =
if config.services.xserver.videoDrivers == ["amdgpu"] # rocblas-6.0.2 broken
then pkgs.pinned.ollama
2025-02-02 15:41:21 +01:00
else pkgs.ollama;
2024-10-20 00:30:58 +02:00
acceleration =
if config.services.xserver.videoDrivers == ["amdgpu"]
then "rocm"
else if config.services.xserver.videoDrivers == ["nvidia"]
then "cuda"
else null;
host = "[::]";
openFirewall = true;
};
2024-11-25 14:59:34 +01:00
nixpkgs.config = {
rocmSupport = config.services.xserver.videoDrivers == ["amdgpu"];
cudaSupport = config.services.xserver.videoDrivers == ["nvidia"];
};
2024-10-20 00:30:58 +02:00
};
}