diff options
| author | Christian <[email protected]> | 2026-06-06 19:36:02 -0500 |
|---|---|---|
| committer | Christian <[email protected]> | 2026-06-06 19:36:02 -0500 |
| commit | 9a21de7a3264519e5e4e2302b472751de023bf22 (patch) | |
| tree | 7842b075fa786c2439241577c3b1d3b29bb85cd2 | |
| parent | df7c578541d2dc11157f86a21992fe92b0d84b6f (diff) | |
Extract local LLM (Ollama/ROCm) config into modules/local-llm.nix
| -rw-r--r-- | hosts/desktop/configuration.nix | 27 | ||||
| -rw-r--r-- | modules/local-llm.nix | 35 |
2 files changed, 36 insertions, 26 deletions
diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 877ff8f..3cdd014 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -6,19 +6,13 @@ ... }: -let - unstable = import inputs.nixpkgs-unstable { - system = "x86_64-linux"; - config.allowUnfree = true; - config.rocmSupport = true; - }; -in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ../../modules/common.nix ../../modules/llm.nix + # ../../modules/local-llm.nix ../../modules/kvm.nix ]; @@ -42,24 +36,5 @@ in services.xserver.videoDrivers = [ "amdgpu" ]; - services.ollama = { - enable = true; - package = unstable.ollama; - acceleration = "rocm"; - rocmOverrideGfx = "10.3.0"; - environmentVariables = { - # This forces ROCm to see ONLY the RX 6800. - # On most Ryzen 7000 systems, '0' is the dGPU and '1' is the iGPU. - HIP_VISIBLE_DEVICES = "0"; - ROCR_VISIBLE_DEVICES = "0"; - - # Keep these for RDNA 2 stability with 26B models - HSA_OVERRIDE_GFX_VERSION = "10.3.0"; - HSA_ENABLE_SDMA = "0"; - }; - }; - - environment.variables.HSA_OVERRIDE_GFX_VERSION = "10.3.0"; - system.stateVersion = "25.11"; } diff --git a/modules/local-llm.nix b/modules/local-llm.nix new file mode 100644 index 0000000..67d4cac --- /dev/null +++ b/modules/local-llm.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: + +let + unstable = import inputs.nixpkgs-unstable { + system = "x86_64-linux"; + config.allowUnfree = true; + config.rocmSupport = true; + }; +in +{ + services.ollama = { + enable = true; + package = unstable.ollama; + acceleration = "rocm"; + rocmOverrideGfx = "10.3.0"; + environmentVariables = { + # This forces ROCm to see ONLY the RX 6800. + # On most Ryzen 7000 systems, '0' is the dGPU and '1' is the iGPU. + HIP_VISIBLE_DEVICES = "0"; + ROCR_VISIBLE_DEVICES = "0"; + + # Keep these for RDNA 2 stability with 26B models + HSA_OVERRIDE_GFX_VERSION = "10.3.0"; + HSA_ENABLE_SDMA = "0"; + }; + }; + + environment.variables.HSA_OVERRIDE_GFX_VERSION = "10.3.0"; +} |
