diff --git a/flake.lock b/flake.lock index 30a6d95b..7f9f47e0 100644 --- a/flake.lock +++ b/flake.lock @@ -212,11 +212,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1760510549, - "narHash": "sha256-NP+kmLMm7zSyv4Fufv+eSJXyqjLMUhUfPT6lXRlg/bU=", + "lastModified": 1760596988, + "narHash": "sha256-+h9FVfiNnsWKpk2HiaecPocq4gWD9GNn5/eVS3I9Z+8=", "owner": "nix-community", "repo": "fenix", - "rev": "ef7178cf086f267113b5c48fdeb6e510729c8214", + "rev": "8e99c7d8e07635dea2e1001485f9de41bb1587f2", "type": "github" }, "original": { @@ -803,11 +803,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1760531859, - "narHash": "sha256-akjHaa54IEBlgeDNwVuuNdkttbDOStgXpDXeJ5GR2QI=", + "lastModified": 1760621586, + "narHash": "sha256-sIbe3te3RrL9PY4ASKGwv1KuJs0pyn4Zvo3xIF3jFms=", "owner": "hyprwm", "repo": "hyprland", - "rev": "ab11af9664a80df70fe3398810b79c4298312a33", + "rev": "8164b90bc2839d4d2a10c0d2b26c4a413ecf90b2", "type": "github" }, "original": { @@ -1278,11 +1278,11 @@ ] }, "locked": { - "lastModified": 1760493063, - "narHash": "sha256-yYqrMI9jg7vTjHu4wOiER9HmqE+NvOqOjfYzuMsTo3Y=", + "lastModified": 1760579393, + "narHash": "sha256-YuXbuaJ/2EZ1FePhz1eTyo/b+kpiEmw4lj6wX0u0Q/0=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "d7f6ab23b939e6e1247321a0e63a89cacb98c03c", + "rev": "7d002241668a738df3973a6c07ef5d79e5508b24", "type": "github" }, "original": { @@ -1443,11 +1443,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1760284886, - "narHash": "sha256-TK9Kr0BYBQ/1P5kAsnNQhmWWKgmZXwUQr4ZMjCzWf2c=", + "lastModified": 1760524057, + "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cf3f5c4def3c7b5f1fc012b3d839575dbe552d43", + "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", "type": "github" }, "original": { @@ -1626,11 +1626,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1760457219, - "narHash": "sha256-WJOUGx42hrhmvvYcGkwea+BcJuQJLcns849OnewQqX4=", + "lastModified": 1760497432, + "narHash": "sha256-ImhJMtnkBlADdrC8jzMDflhA4WMdaCRKkhsJC2pzPcM=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "8747cf81540bd1bbbab9ee2702f12c33aa887b46", + "rev": "fcfff0827f64a91f5676d617f0d4dd8b58eefbd1", "type": "github" }, "original": { diff --git a/hosts/bunk/modules.nix b/hosts/bunk/modules.nix index 895a4ef0..813994c3 100644 --- a/hosts/bunk/modules.nix +++ b/hosts/bunk/modules.nix @@ -3,7 +3,7 @@ boot = { kernel = { variant = "latest"; - hardware = [ "amd" ]; + hardware = ["amd"]; }; loader = { default = { @@ -20,7 +20,7 @@ }; graphics = { enable = true; - vendors = [ "amd" ]; + vendors = ["amd"]; }; logitech = { enable = false; @@ -73,8 +73,8 @@ enable = false; }; hyprland = { - enable = false; - withUWSM = false; + enable = true; + withUWSM = true; }; inkscape = { enable = false; @@ -86,7 +86,7 @@ enable = true; }; niri = { - enable = true; + enable = false; }; pkgs = { enable = true; diff --git a/hosts/sobotka/server.nix b/hosts/sobotka/server.nix index 800dc2ca..3a430012 100644 --- a/hosts/sobotka/server.nix +++ b/hosts/sobotka/server.nix @@ -73,6 +73,18 @@ category = "Services"; }; }; + ollama = { + enable = true; + subdomain = "ai"; + exposure = "local"; + port = 8001; + homepage = { + name = "ollama"; + description = "AI platform"; + icon = "ollama.svg"; + category = "Services"; + }; + }; bazarr = { enable = true; subdomain = "bazarr"; diff --git a/modules/server/infra/podman/default.nix b/modules/server/infra/podman/default.nix index 7b5904ec..46fb78f1 100644 --- a/modules/server/infra/podman/default.nix +++ b/modules/server/infra/podman/default.nix @@ -157,6 +157,38 @@ in { ]; }; }) + (lib.mkIf cfg.ollama.enable { + intel-llm = { + autoStart = true; + image = "intelanalytics/ipex-llm-inference-cpp-xpu:latest"; + devices = [ + "/dev/dri:/dev/dri:rwm" + ]; + volumes = [ + "/var/lib/ollama:/models" + ]; + environment = { + OLLAMA_ORIGINS = "http://192.168.*"; + SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS = "1"; + ONEAPI_DEVICE_SELECTOR = "level_zero:0"; + OLLAMA_HOST = "[::]:11434"; + no_proxy = "localhost,127.0.0.1"; + DEVICE = "Arc"; + OLLAMA_NUM_GPU = "999"; + ZES_ENABLE_SYSMAN = "1"; + }; + cmd = [ + "/bin/sh" + "-c" + "/llm/scripts/start-ollama.sh && echo 'Startup script finished, container is now idling.' && sleep infinity" + ]; + extraOptions = [ + "--net=host" + "--memory=32G" + "--shm-size=16g" + ]; + }; + }) ]; }; } diff --git a/modules/server/services/default.nix b/modules/server/services/default.nix index 710e86f9..f039b2b9 100644 --- a/modules/server/services/default.nix +++ b/modules/server/services/default.nix @@ -9,6 +9,7 @@ ./lidarr ./n8n ./nextcloud + ./ollama ./prowlarr ./radarr ./sonarr diff --git a/modules/server/services/ollama/default.nix b/modules/server/services/ollama/default.nix new file mode 100644 index 00000000..abccb67b --- /dev/null +++ b/modules/server/services/ollama/default.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: let + unit = "ollama"; + cfg = config.server.services.${unit}; +in { + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + intel-compute-runtime + intel-graphics-compiler + level-zero + ]; + services.open-webui = { + enable = true; + host = "0.0.0.0"; + port = 8001; + environment = { + ANONYMIZED_TELEMETRY = "False"; + BYPASS_MODEL_ACCESS_CONTROL = "True"; + OLLAMA_BASE_URL = "http://localhost:11434"; + }; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index ef9fad1d..a619e528 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,12 +5,10 @@ "aarch64-linux" ]; - perSystem = - { pkgs, ... }: - { - packages = { - # instant repl with automatic flake loading - repl = pkgs.callPackage ./repl { }; - }; + perSystem = {pkgs, ...}: { + packages = { + # instant repl with automatic flake loading + repl = pkgs.callPackage ./repl {}; }; + }; }