From 45b07a1e2572ec623cfb2497e17597031a7ec32a Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 28 Jan 2026 16:11:55 -0500 Subject: [PATCH 1/5] linuxPackages.lttng-modules: Drop unneeded NIX_CFLAGS_COMPILE Added wayyyy back in 2676cf9525c38ac8c6cb85a7d95f2e57e2760c3d, this NIX_CFLAGS_COMPILE usage is now unneeded. It *necessarily* had to be unneeded, as using kernelModuleMakeFlags and the kernel's out-of-tree build tooling forces the unwrapped `cc` to be used. See here: https://github.com/NixOS/nixpkgs/blame/f86e9fe549f551d6bb738a1d01efa7d61b2da3e7/pkgs/os-specific/linux/kernel/common-flags.nix#L10-L11 --- pkgs/os-specific/linux/lttng-modules/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/linux/lttng-modules/default.nix b/pkgs/os-specific/linux/lttng-modules/default.nix index 6a8d645247aa..669f45562cb4 100644 --- a/pkgs/os-specific/linux/lttng-modules/default.nix +++ b/pkgs/os-specific/linux/lttng-modules/default.nix @@ -21,8 +21,6 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; - makeFlags = kernelModuleMakeFlags ++ [ "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=${placeholder "out"}" From 31a506f73426a62b5b4f145a1651232c1d51ae48 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 28 Jan 2026 16:15:12 -0500 Subject: [PATCH 2/5] linuxPackages.rtl8814au: Drop unneeded NIX_CFLAGS_COMPILE This usage was added in 0ab8bf61affb83ebe1a32e4b0854c59b8f0e70bc, when the package was added. It *necessarily* has to be unneeded, as using kernelModuleMakeFlags and the kernel's out-of-tree build tooling forces the unwrapped `cc` to be used. See here: https://github.com/NixOS/nixpkgs/blame/f86e9fe549f551d6bb738a1d01efa7d61b2da3e7/pkgs/os-specific/linux/kernel/common-flags.nix#L10-L11 --- pkgs/os-specific/linux/rtl8814au/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/linux/rtl8814au/default.nix b/pkgs/os-specific/linux/rtl8814au/default.nix index 8cdc1b4dd386..3e6a8d61be14 100644 --- a/pkgs/os-specific/linux/rtl8814au/default.nix +++ b/pkgs/os-specific/linux/rtl8814au/default.nix @@ -22,8 +22,6 @@ stdenv.mkDerivation { hardeningDisable = [ "pic" ]; - env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - prePatch = '' substituteInPlace ./Makefile \ --replace /lib/modules/ "${kernel.dev}/lib/modules/" \ From 7f8e850ba4c7704a4fcb7203f2483c055f451cbe Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 28 Jan 2026 16:18:02 -0500 Subject: [PATCH 3/5] linuxPackages.digimend: Drop unneeded NIX_CFLAGS_COMPILE This use was added in ddf273588e069b5267d116d8539dab09e8bb55ba. It *necessarily* has to be unneeded, as using kernelModuleMakeFlags and the kernel's out-of-tree build tooling forces the unwrapped `cc` to be used. See here: https://github.com/NixOS/nixpkgs/blame/f86e9fe549f551d6bb738a1d01efa7d61b2da3e7/pkgs/os-specific/linux/kernel/common-flags.nix#L10-L11 --- pkgs/os-specific/linux/digimend/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/os-specific/linux/digimend/default.nix b/pkgs/os-specific/linux/digimend/default.nix index c5292d70cb1b..2229ac5ab0fc 100644 --- a/pkgs/os-specific/linux/digimend/default.nix +++ b/pkgs/os-specific/linux/digimend/default.nix @@ -22,9 +22,6 @@ stdenv.mkDerivation { sed 's/depmod /true /' -i Makefile ''; - # Fix build on Linux kernel >= 5.18 - env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-fallthrough" ]; - nativeBuildInputs = kernel.moduleBuildDependencies; makeFlags = kernelModuleMakeFlags ++ [ From 857adb6674b6f18b6719976d2a700819fa3389d1 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 28 Jan 2026 20:06:22 -0500 Subject: [PATCH 4/5] linuxPackages.nvidia_x11.open: Drop unneeded NIX_CFLAGS_COMPILE The usage of NIX_CFLAGS_COMPILE was added in 2023, in commit 2a6b15d371f31796c8bcd6521328b109a04608ef. When going back to that commit, removing the added flag, and building with: $ nix-build pkgsCross.aarch64-multiplatform.linuxPackages.nvidia_x11_beta_open ...the build fails. With the current state of Nixpkgs, the build completes whether or not the flag is used. This *necessarily* has to be unneeded, as using kernelModuleMakeFlags and the kernel's out-of-tree build tooling forces the unwrapped `cc` to be used... *For `CC` uses*. This situation may be a bit wonkier than the others, since `CXX` usage is *not* affected by the (debatable?) regression. This can be observed experimentally by setting `NIX_CFLAGS_COMPILE` to some bogus value that won't work. The build will fail only when invoking the C++ compiler. Context here: https://github.com/NixOS/nixpkgs/blame/f86e9fe549f551d6bb738a1d01efa7d61b2da3e7/pkgs/os-specific/linux/kernel/common-flags.nix#L10-L11 --- pkgs/os-specific/linux/nvidia-x11/open.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/open.nix b/pkgs/os-specific/linux/nvidia-x11/open.nix index e095cc47facb..fe4d1acb44e2 100644 --- a/pkgs/os-specific/linux/nvidia-x11/open.nix +++ b/pkgs/os-specific/linux/nvidia-x11/open.nix @@ -58,7 +58,4 @@ stdenv.mkDerivation ( inherit broken; }; } - // lib.optionalAttrs stdenv.hostPlatform.isAarch64 { - env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; - } ) From 4cf099174b260fe73d02b16f456e2bd14334f293 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 28 Jan 2026 20:36:49 -0500 Subject: [PATCH 5/5] linuxPackages.nvidia_x11.open: Format file Done separately from 857adb6674b6f18b6719976d2a700819fa3389d1 so the actual change is not hidden through this huge reformat. --- pkgs/os-specific/linux/nvidia-x11/open.nix | 84 +++++++++++----------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/open.nix b/pkgs/os-specific/linux/nvidia-x11/open.nix index fe4d1acb44e2..5a897e0dd138 100644 --- a/pkgs/os-specific/linux/nvidia-x11/open.nix +++ b/pkgs/os-specific/linux/nvidia-x11/open.nix @@ -10,52 +10,50 @@ broken ? false, }: -stdenv.mkDerivation ( - { - pname = "nvidia-open"; - version = "${kernel.version}-${nvidia_x11.version}"; +stdenv.mkDerivation { + pname = "nvidia-open"; + version = "${kernel.version}-${nvidia_x11.version}"; - src = fetchFromGitHub { - owner = "NVIDIA"; - repo = "open-gpu-kernel-modules"; - rev = nvidia_x11.version; - inherit hash; - }; + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = "open-gpu-kernel-modules"; + rev = nvidia_x11.version; + inherit hash; + }; - inherit patches; + inherit patches; - nativeBuildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = - kernelModuleMakeFlags - ++ [ - "IGNORE_PREEMPT_RT_PRESENCE=1" - "SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" - "SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - "MODLIB=$(out)/lib/modules/${kernel.modDirVersion}" - "DATE=" - "TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}" - ] - ++ lib.optionals stdenv.cc.isClang [ - "C_INCLUDE_PATH=${lib.getLib stdenv.cc.cc}/lib/clang/${lib.versions.major stdenv.cc.cc.version}/include" - ]; + makeFlags = + kernelModuleMakeFlags + ++ [ + "IGNORE_PREEMPT_RT_PRESENCE=1" + "SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" + "SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "MODLIB=$(out)/lib/modules/${kernel.modDirVersion}" + "DATE=" + "TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}" + ] + ++ lib.optionals stdenv.cc.isClang [ + "C_INCLUDE_PATH=${lib.getLib stdenv.cc.cc}/lib/clang/${lib.versions.major stdenv.cc.cc.version}/include" + ]; - installTargets = [ "modules_install" ]; - enableParallelBuilding = true; + installTargets = [ "modules_install" ]; + enableParallelBuilding = true; - meta = { - description = "NVIDIA Linux Open GPU Kernel Module"; - homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules"; - license = with lib.licenses; [ - gpl2Plus - mit - ]; - platforms = [ - "x86_64-linux" - "aarch64-linux" - ]; - maintainers = with lib.maintainers; [ nickcao ]; - inherit broken; - }; - } -) + meta = { + description = "NVIDIA Linux Open GPU Kernel Module"; + homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules"; + license = with lib.licenses; [ + gpl2Plus + mit + ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + ]; + maintainers = with lib.maintainers; [ nickcao ]; + inherit broken; + }; +}