I’m trying to build the most recent NVidia drivers, while using NixOS stable (25.11) with kernel 6.18.8. But it fails like this:
error: Cannot build '/nix/store/zx4q8jrlw1ni2j4bjwcshkhdbf0da6ak-nvidia-open-6.18.8-590.48.01.drv'.
Reason: builder failed with exit code 2.
Output paths:
/nix/store/nqj034a78nhs66r82wq39hc747090z9c-nvidia-open-6.18.8-590.48.01
Last 18 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/wmypfkr7wlgj8w65kjv33k83mm4s8r8w-source
> source root is source
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> no configure script, doing nothing
> Running phase: buildPhase
> build flags: -j12 SHELL=/nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash CC=/nix/store/m1k4nxs8r0fl0pjxqp5n37vxgms7gdlb-gcc-14.3.0/bin/gcc LD=/nix/store/v9zpzmigqkcjrw1jpf0zjc49y47cm55s-binutils-2.44/bin/ld AR=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/ar NM=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/nm STRIP=/nix/store/v9zpzmigqkcjrw1jpf0zjc49y47cm55s-binutils-2.44/bin/strip OBJCOPY=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/objcopy OBJDUMP=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/objdump READELF=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/readelf HOSTCC=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/cc HOSTCXX=/nix/store/myvv172x2am72534zgn9wx0qp5amq6a8-gcc-wrapper-14.3.0/bin/c++ HOSTAR=/nix/store/4dh4138m8gbp56kh63j2pwgsfhf5l8v7-binutils-wrapper-2.44/bin/ar HOSTLD=/nix/store/4dh4138m8gbp56kh63j2pwgsfhf5l8v7-binutils-wrapper-2.44/bin/ld ARCH=x86_64 CROSS_COMPILE= KBUILD_OUTPUT=/nix/store/7zf8vhaizwvyj8226dpbdk48h4c0n7k2-linux-6.18.8-dev/lib/modules/6.18.8/build IGNORE_PREEMPT_RT_PRESENCE=1 SYSSRC=/nix/store/7zf8vhaizwvyj8226dpbdk48h4c0n7k2-linux-6.18.8-dev/lib/modules/6.18.8/source SYSOUT=/nix/store/7zf8vhaizwvyj8226dpbdk48h4c0n7k2-linux-6.18.8-dev/lib/modules/6.18.8/build MODLIB=\$\(out\)/lib/modules/6.18.8 DATE= TARGET_ARCH=x86_64
> make[1]: Entering directory '/build/source/src'
> /nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash: line 1: pkg-config: command not found
> /nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash: line 1: pkg-config: command not found
> /nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash: line 1: pkg-config: command not found
> /nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash: line 1: pkg-config: command not found
> /nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3/bin/bash: line 1: pkg-config: command not found
> Makefile:362: *** Neither GTK2 nor GTK3 build dependencies found; please check `pkg-config --exists gtk+-3.0`. Stop.
> make[1]: Leaving directory '/build/source/src'
> make: *** [Makefile:23: all] Error 2
For full logs, run:
nix log /nix/store/zx4q8jrlw1ni2j4bjwcshkhdbf0da6ak-nvidia-open-6.18.8-590.48.01.drv
error: Cannot build '/nix/store/a5gm7pcrb858wgnknpca5668wrfjpigv-linux-6.18.8-modules.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/51szfi014g4z1l40pr4asrxca36wpfjk-linux-6.18.8-modules
error: Cannot build '/nix/store/qacvric1vbs28b998rm4a3z3plpbrxcs-nixos-system-homer-25.11.20260202.d04d854.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/yfgd43w49f780593np1wkjrkibjqbfxn-nixos-system-homer-25.11.20260202.d04d854
This is my related config (used the NixOS Wiki example as a template):
{
hardware.graphics = {
enable = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = false;
# package = config.boot.kernelPackages.nvidiaPackages.latest;
# package = config.boot.kernelPackages.nvidiaPackages.beta;
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "590.48.01";
sha256_64bit = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
sha256_aarch64 = "sha256-BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=";
openSha256 = "sha256-NWsqUciPa4f1ZX6f0By3yScz3pqKJV1ei9GvOF8qIEE=";
settingsSha256 = "sha256-CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC=";
persistencedSha256 = "sha256-DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD=";
useSettings = false;
};
};
}
I thought that the GTK dependencies may be related to building nvidia-settings, so I tried to disable it. But I still get those dependency errors. Where are they coming from? And why is the mkDriver function not adding all build dependencies? I’m very confused…