From 4c615c843486a268b7344b9fe6c52c8314bc4647 Mon Sep 17 00:00:00 2001
From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com>
Date: Sun, 2 Mar 2025 17:52:38 +0200
Subject: [PATCH 1/5] nix_example.md: format

---
 examples/nix_example.md | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/examples/nix_example.md b/examples/nix_example.md
index 8ffb736f21cbe..47bd0ed3267f4 100644
--- a/examples/nix_example.md
+++ b/examples/nix_example.md
@@ -1,10 +1,13 @@
 # Guide to Nix for KoboldCpp
 
-- KoboldCpp is available on Nixpkgs and can be installed by adding just `koboldcpp` to your `environment.systemPackages` *(or it can also be placed in `home.packages`)*.
+- KoboldCpp is available on Nixpkgs and can be installed by adding just
+`koboldcpp` to your `environment.systemPackages` *(or it can also be placed
+in `home.packages`)*.
 
 ## KoboldCpp Nix - CUDA Support
 
-In order to enable NVIDIA CUDA support, you'll need to configure several settings:
+In order to enable NVIDIA CUDA support, you'll need to configure several
+settings:
 
 - Enable required options:
 
@@ -60,11 +63,17 @@ environment.systemPackages = [ pkgs.koboldcpp ];
 
 ## KoboldCpp - Home Manager
 
-The setup for Home Manager is the same as regular Nix, with one exception regarding Home Manager's instance of nixpkgs. By default, Home Manager manages its own isolated instance of nixpkgs, which has two implications:
+The setup for Home Manager is the same as regular Nix, with one exception
+regarding Home Manager's instance of nixpkgs. By default, Home Manager manages
+its own isolated instance of nixpkgs, which has two implications:
 
-1. You can keep your private Home Manager nixpkgs instance and simply repeat your `nixpkgs.config` in home manager.
-2. You can set `home-manager.useGlobalPkgs = true;` to copy your module system's nixpkgs instance. This way, you only need to define it in your `configuration.nix`, and Home Manager will "inherit" this configuration.
+1. You can keep your private Home Manager nixpkgs instance and simply repeat
+your `nixpkgs.config` in home manager.
+2. You can set `home-manager.useGlobalPkgs = true;` to copy your module
+system's nixpkgs instance. This way, you only need to define it in your
+`configuration.nix`, and Home Manager will "inherit" this configuration.
 
 ## Getting Help for KoboldCpp Nix
 
-- If you face any issues with running KoboldCpp on Nix, please open an issue [here](https://github.com/NixOS/nixpkgs/issues/new?assignees=&labels=0.kind%3A+bug&projects=&template=bug_report.md&title=)
+- If you face any issues with running KoboldCpp on Nix, please open an issue
+[here](https://github.com/NixOS/nixpkgs/issues/new?assignees=&labels=0.kind%3A+bug&projects=&template=bug_report.md&title=)

From 204546b01307b0ab574caad0564d9fa8e3d7720d Mon Sep 17 00:00:00 2001
From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com>
Date: Sun, 2 Mar 2025 18:00:21 +0200
Subject: [PATCH 2/5] nix_example.md: Vulkan is disabled on macOS

Disabled in: https://github.com/NixOS/nixpkgs/commit/1ccd253accfb140acbf9da9f56d9dc6d3aece088
---
 examples/nix_example.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/nix_example.md b/examples/nix_example.md
index 47bd0ed3267f4..3d82f810eb455 100644
--- a/examples/nix_example.md
+++ b/examples/nix_example.md
@@ -40,7 +40,7 @@ To find your GPU's architecture code:
 
 ## Hardware Support
 
-- ✅ Vulkan: Enabled by default on Linux and macOS
+- ✅ Vulkan: Enabled by default on Linux
 - ✅ Metal: Enabled by default on macOS
 - ❌ ROCm: Not currently available
 

From 043e54ad67d8842ea44b404b08f4fd794c9e7e57 Mon Sep 17 00:00:00 2001
From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com>
Date: Sun, 2 Mar 2025 18:03:02 +0200
Subject: [PATCH 3/5] nix_examples.md: nixpkgs.config.cuda{Arches ->
 Capabilities}

Fixes: https://github.com/LostRuins/koboldcpp/issues/1367
---
 examples/nix_example.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/nix_example.md b/examples/nix_example.md
index 3d82f810eb455..67e02ff2f7110 100644
--- a/examples/nix_example.md
+++ b/examples/nix_example.md
@@ -29,7 +29,7 @@ hardware.graphics.enable = true;
 - Set your GPU architecture:
 
 ```nix
-nixpkgs.config.cudaArches = [ "sm_75" ];  # Example for RTX 2080
+nixpkgs.config.cudaCapabilities = [ "sm_75" ];  # Example for RTX 2080
 ```
 
 To find your GPU's architecture code:
@@ -50,7 +50,7 @@ To find your GPU's architecture code:
 nixpkgs.config = {
   allowUnfree = true;
   cudaSupport = true;
-  cudaArches = [ "sm_75" ];
+  cudaCapabilities = [ "sm_75" ];
 };
 # NixOS 24.05
 hardware.opengl.enable = true;

From 65b8dd4cf5e5ce795fbe8699bde67e737c186866 Mon Sep 17 00:00:00 2001
From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com>
Date: Sun, 2 Mar 2025 18:09:17 +0200
Subject: [PATCH 4/5] nix_example.md: add override example

---
 examples/nix_example.md | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/nix_example.md b/examples/nix_example.md
index 67e02ff2f7110..6bad3cee0e58d 100644
--- a/examples/nix_example.md
+++ b/examples/nix_example.md
@@ -59,6 +59,11 @@ hardware.opengl.enable = true;
 environment.systemPackages = [ pkgs.koboldcpp ];
 # If you're using home-manager to install KoboldCpp
 # home.packages = [ pkgs.koboldcpp ];
+
+# You can also just override koboldcpp to add your CUDA architecture:
+# environment.systemPackages = [ (koboldcpp.override { cudaArches = ["sm_75"]; }) ]
+# or
+# home.packages = [ (koboldcpp.override { cudaArches = ["sm_75"]; }) ];
 ```
 
 ## KoboldCpp - Home Manager

From a3c18b6cfacd754ffcc3203ef5b53e24b3824e35 Mon Sep 17 00:00:00 2001
From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com>
Date: Sun, 2 Mar 2025 18:11:05 +0200
Subject: [PATCH 5/5] nix_example.md: drop graphics example, already basic
 nixos knowledge

---
 examples/nix_example.md | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/examples/nix_example.md b/examples/nix_example.md
index 6bad3cee0e58d..54537062bbcdc 100644
--- a/examples/nix_example.md
+++ b/examples/nix_example.md
@@ -16,16 +16,6 @@ nixpkgs.config.allowUnfree = true;    # Allow proprietary software
 nixpkgs.config.cudaSupport = true;    # Enable CUDA functionality
 ```
 
-- Enable graphics support based on your NixOS version:
-
-```nix
-# For NixOS 24.05:
-hardware.opengl.enable = true;
-
-# For NixOS 24.11 or unstable:
-hardware.graphics.enable = true;
-```
-
 - Set your GPU architecture:
 
 ```nix
@@ -52,10 +42,6 @@ nixpkgs.config = {
   cudaSupport = true;
   cudaCapabilities = [ "sm_75" ];
 };
-# NixOS 24.05
-hardware.opengl.enable = true;
-# NixOS 24.11 or unstable
-# hardware.graphics.enable = true;
 environment.systemPackages = [ pkgs.koboldcpp ];
 # If you're using home-manager to install KoboldCpp
 # home.packages = [ pkgs.koboldcpp ];