{ config, pkgs, inputs, ... }: let unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.hostPlatform.system; config.allowUnfree = true; }; in { imports = [ ./hardware.nix ../../system ]; networking.hostName = "lilac"; services.fwupd.enable = true; services.fprintd.enable = true; services.hardware.bolt.enable = true; system.stateVersion = "26.05"; environment.systemPackages = with pkgs; [ framework-tool # GPU compute diagnostics clinfo vulkan-tools intel-gpu-tools # Vulkan-accelerated llama.cpp CLI/server for manual/advanced use (llama-cpp.override { vulkanSupport = true; }) ]; boot.kernelModules = [ "bnep" ]; networking.interfaces.bnep0.ipv4.addresses = [{ address = "10.0.0.1"; prefixLength = 24; }]; networking.firewall.interfaces."bnep0".allowedUDPPorts = [ 4242 ]; systemd = { services = { # 1. Start the listening server profile bt-pan-server = { description = "Bluetooth PAN GN Server"; after = [ "bluetooth.service" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = "${pkgs.bluez-tools}/bin/bt-network -s nap bnep"; Restart = "always"; RestartSec = 5; }; }; }; }; hardware.graphics = { enable = true; enable32Bit = true; extraPackages = with pkgs; [ intel-media-driver # Hardware video acceleration intel-vaapi-driver vpl-gpu-rt # Video processing runtime intel-compute-runtime # OpenCL + Level Zero GPU compute (Arc iGPU) # Explicit Vulkan Support for Ollama-Vulkan vulkan-loader vulkan-validation-layers vulkan-tools # Useful for running `vulkaninfo` to verify the iGPU ]; extraPackages32 = with pkgs.pkgsi686Linux; [ intel-media-driver ]; }; services.power-profiles-daemon.enable = true; services.thermald.enable = true; services.ollama = { enable = true; package = unstable.ollama-vulkan; environmentVariables = { OLLAMA_IGPU_ENABLE = "1"; # Forces Ollama to strictly leverage Vulkan device routing GGML_VULKAN_DEVICE = "0"; # Prevents multi-model concurrency thrashing on unified memory OLLAMA_NUM_PARALLEL = "1"; OLLAMA_KEEP_ALIVE = "-1"; # Optional: Set flash attention or high context limits if desired #OLLAMA_FLASH_ATTENTION = "1"; #OLLAMA_CONTEXT_LENGTH = "16384"; }; }; }