Add Ollama service with GPU support

This commit is contained in:
Christopher Mühl 2025-12-19 09:24:41 +01:00
parent fa16e5232f
commit f47f761bb8
No known key found for this signature in database
GPG key ID: E919B0F59E14FD47
4 changed files with 41 additions and 0 deletions

View file

@ -2,5 +2,6 @@
imports = [ imports = [
./lnxlink.nix ./lnxlink.nix
./beszel.nix ./beszel.nix
./ollama.nix
]; ];
} }

View file

@ -0,0 +1,36 @@
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.services.elements.ollama;
in {
options.services.elements = {
ollama.enable = mkEnableOption "Enable Ollama";
};
config = mkIf cfg.enable {
services = {
ollama = {
enable = true;
user = "ollama";
host = "0.0.0.0";
openFirewall = true;
acceleration = "rocm";
};
qdrant = {
enable = true;
# settings = {};
};
open-webui = {
enable = true;
host = "0.0.0.0";
openFirewall = true;
};
};
};
}

View file

@ -9,6 +9,9 @@
orca-slicer orca-slicer
claude-code claude-code
lutris lutris
ollama
# currently doesn't build on unstable
# open-webui
; ;
bambu-studio = channels.unstable.bambu-studio.overrideAttrs (old: let bambu-studio = channels.unstable.bambu-studio.overrideAttrs (old: let

View file

@ -102,6 +102,7 @@ with lib._elements; {
lnxlink.enable = true; lnxlink.enable = true;
beszel-agent.enable = true; beszel-agent.enable = true;
beszel-agent.key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T"; beszel-agent.key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T";
elements.ollama.enable = true;
pipewire = { pipewire = {
enable = lib.mkForce true; enable = lib.mkForce true;