From dfc095c6ac7ff171d68531db66ba1d44062f8060 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:12 +0100 Subject: [PATCH 01/34] adlplug: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ad/adlplug/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ad/adlplug/package.nix b/pkgs/by-name/ad/adlplug/package.nix index 1eadcfd29e26..c015a502fa8a 100644 --- a/pkgs/by-name/ad/adlplug/package.nix +++ b/pkgs/by-name/ad/adlplug/package.nix @@ -66,7 +66,7 @@ stdenv.mkDerivation { ./cmake-v4.patch ]; - NIX_LDFLAGS = toString ( + env.NIX_LDFLAGS = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ # Framework that JUCE needs which don't get linked properly "-framework CoreAudioKit" From db5415b3fae61eba158ea6b4930be5ebcddec2d4 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:13 +0100 Subject: [PATCH 02/34] aescrypt: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ae/aescrypt/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ae/aescrypt/package.nix b/pkgs/by-name/ae/aescrypt/package.nix index 5b01512cc890..3d83142a94a1 100644 --- a/pkgs/by-name/ae/aescrypt/package.nix +++ b/pkgs/by-name/ae/aescrypt/package.nix @@ -14,7 +14,9 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-4uGS0LReq5dI7+Wel7ZWzFXx+utZWi93q4TUSw7AhNI="; }; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-liconv"; + }; preBuild = '' substituteInPlace src/Makefile --replace "CC=gcc" "CC?=gcc" From e9a89dbbe100161b44fdf9ab6b091e143c7c8ba6 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:13 +0100 Subject: [PATCH 03/34] ahoviewer: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ah/ahoviewer/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ah/ahoviewer/package.nix b/pkgs/by-name/ah/ahoviewer/package.nix index 3824cda9795a..4b46fe0a4510 100644 --- a/pkgs/by-name/ah/ahoviewer/package.nix +++ b/pkgs/by-name/ah/ahoviewer/package.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional useUnrar unrar; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; postPatch = "patchShebangs version.sh"; From 08ea7614242806d26fbaf61e6dea5f3aee108ab1 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:13 +0100 Subject: [PATCH 04/34] airstrike: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ai/airstrike/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ai/airstrike/package.nix b/pkgs/by-name/ai/airstrike/package.nix index c0eb06eeba78..13e01a21e526 100644 --- a/pkgs/by-name/ai/airstrike/package.nix +++ b/pkgs/by-name/ai/airstrike/package.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (finalAttrs: { SDL_image ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; installPhase = '' mkdir -p $out/bin From e6b4ae9f3b2793266fb8299696f8d397a5d216f1 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:13 +0100 Subject: [PATCH 05/34] airwin2rack: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ai/airwin2rack/package.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ai/airwin2rack/package.nix b/pkgs/by-name/ai/airwin2rack/package.nix index 4437cafb965b..1c330993fd43 100644 --- a/pkgs/by-name/ai/airwin2rack/package.nix +++ b/pkgs/by-name/ai/airwin2rack/package.nix @@ -175,17 +175,15 @@ stdenv.mkDerivation { runHook postInstall ''; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXrender" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXrender" + ]; meta = { description = "JUCE Plugin Version of Airwindows Consolidated"; From 2b6a0527fe60bd6ce061a64b7bc025e80d31123b Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:14 +0100 Subject: [PATCH 06/34] bloodspilot-client: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/bl/bloodspilot-client/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/bl/bloodspilot-client/package.nix b/pkgs/by-name/bl/bloodspilot-client/package.nix index 7436908119bb..fbe24e541983 100644 --- a/pkgs/by-name/bl/bloodspilot-client/package.nix +++ b/pkgs/by-name/bl/bloodspilot-client/package.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - NIX_LDFLAGS = "-lX11"; + env.NIX_LDFLAGS = "-lX11"; meta = { description = "Multiplayer space combat game (client part)"; From b83e25579c533b39bb40bfbf7f22bd26b1e653ab Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:14 +0100 Subject: [PATCH 07/34] boinc: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/bo/boinc/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/bo/boinc/package.nix b/pkgs/by-name/bo/boinc/package.nix index 7d037a93aaf9..4550239740d1 100644 --- a/pkgs/by-name/bo/boinc/package.nix +++ b/pkgs/by-name/bo/boinc/package.nix @@ -67,7 +67,9 @@ stdenv.mkDerivation rec { xcbutil ]; - NIX_LDFLAGS = lib.optionalString (!headless) "-lX11"; + env = lib.optionalAttrs (!headless) { + NIX_LDFLAGS = "-lX11"; + }; preConfigure = '' ./_autosetup From c24c6df3cd4e9fad06808935f21865ef31616310 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:14 +0100 Subject: [PATCH 08/34] brush-splat: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/br/brush-splat/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/br/brush-splat/package.nix b/pkgs/by-name/br/brush-splat/package.nix index d53edccbb667..9f8c7f33151c 100644 --- a/pkgs/by-name/br/brush-splat/package.nix +++ b/pkgs/by-name/br/brush-splat/package.nix @@ -30,7 +30,7 @@ rustPlatform.buildRustPackage (finalAttrs: { # Force linking to libEGL, which is always dlopen()ed, and to # libwayland-client & libxkbcommon, which is dlopen()ed based on the # winit backend. - NIX_LDFLAGS = [ + env.NIX_LDFLAGS = toString [ "--no-as-needed" "-lvulkan" "-lwayland-client" From 28f82689a1c7ef382f9b45dffda52f372d798222 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:14 +0100 Subject: [PATCH 09/34] buddy: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/bu/buddy/package.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bu/buddy/package.nix b/pkgs/by-name/bu/buddy/package.nix index f47823a3c8fe..6cf0e511e423 100644 --- a/pkgs/by-name/bu/buddy/package.nix +++ b/pkgs/by-name/bu/buddy/package.nix @@ -20,8 +20,13 @@ stdenv.mkDerivation rec { "CFLAGS=-O3" "CXXFLAGS=-O3" ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=register"; - NIX_LDFLAGS = "-lm"; + env = { + NIX_LDFLAGS = "-lm"; + } + // lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = "-Wno-error=register"; + }; + doCheck = true; meta = { From eac03580b6a638f0d3f4a51c34ef26257ca67a8f Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:14 +0100 Subject: [PATCH 10/34] cargo-watch: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ca/cargo-watch/package.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ca/cargo-watch/package.nix b/pkgs/by-name/ca/cargo-watch/package.nix index bb066eac03a7..a3982a5e7f2e 100644 --- a/pkgs/by-name/ca/cargo-watch/package.nix +++ b/pkgs/by-name/ca/cargo-watch/package.nix @@ -18,10 +18,12 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-4AVZ747d6lOjxHN+co0A7APVB5Xj6g5p/Al5fLbgPnc="; - NIX_LDFLAGS = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - "-framework" - "AppKit" - ]; + env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) { + NIX_LDFLAGS = toString [ + "-framework" + "AppKit" + ]; + }; # `test with_cargo` tries to call cargo-watch as a cargo subcommand # (calling cargo-watch with command `cargo watch`) From 2c629505aaa31ce0486d0c8229fc06c43681a956 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:15 +0100 Subject: [PATCH 11/34] chow-tape-model: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ch/chow-tape-model/package.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ch/chow-tape-model/package.nix b/pkgs/by-name/ch/chow-tape-model/package.nix index e61a13ab1618..263a5747f9f1 100644 --- a/pkgs/by-name/ch/chow-tape-model/package.nix +++ b/pkgs/by-name/ch/chow-tape-model/package.nix @@ -116,15 +116,13 @@ stdenv.mkDerivation (finalAttrs: { # JUCE dlopens these, make sure they are in rpath # Otherwise, segfault will happen - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcursor" - "-lXinerama" - "-lXrandr" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcursor" + "-lXinerama" + "-lXrandr" + ]; meta = { homepage = "https://github.com/jatinchowdhury18/AnalogTapeModel"; From b2b391c6acf57c9da9af731aec9dfe9475d1396d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:15 +0100 Subject: [PATCH 12/34] chunksync: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ch/chunksync/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ch/chunksync/package.nix b/pkgs/by-name/ch/chunksync/package.nix index 179619c35068..293c092d7e04 100644 --- a/pkgs/by-name/ch/chunksync/package.nix +++ b/pkgs/by-name/ch/chunksync/package.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation (finalAttrs: { perl ]; - NIX_LDFLAGS = "-lgcc_s"; + env.NIX_LDFLAGS = "-lgcc_s"; makeFlags = [ "DESTDIR=$(out)" From 3dff1b5ba93a4c22a1f6e9b3eaea0a8a52caadf4 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:15 +0100 Subject: [PATCH 13/34] cre2: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/cr/cre2/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/cr/cre2/package.nix b/pkgs/by-name/cr/cre2/package.nix index 9a058fd4d3bf..43b106f29418 100644 --- a/pkgs/by-name/cr/cre2/package.nix +++ b/pkgs/by-name/cr/cre2/package.nix @@ -30,7 +30,10 @@ stdenv.mkDerivation (finalAttrs: { texinfo ]; - NIX_LDFLAGS = "-lre2 -lpthread"; + env.NIX_LDFLAGS = toString [ + "-lre2" + "-lpthread" + ]; configureFlags = [ "--enable-maintainer-mode" From 24e7476369f62ce05dbda3afb0591babf9493e35 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:16 +0100 Subject: [PATCH 14/34] ddrescueview: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/dd/ddrescueview/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/dd/ddrescueview/package.nix b/pkgs/by-name/dd/ddrescueview/package.nix index 50828787fa1c..e0e08cd68b5d 100644 --- a/pkgs/by-name/dd/ddrescueview/package.nix +++ b/pkgs/by-name/dd/ddrescueview/package.nix @@ -38,7 +38,11 @@ stdenv.mkDerivation rec { pango ]; - NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + env.NIX_LDFLAGS = toString [ + "--as-needed" + "-rpath" + (lib.makeLibraryPath buildInputs) + ]; buildPhase = '' lazbuild --lazarusdir=${lazarus}/share/lazarus ddrescueview.lpi From 4d1e89f28d0abbb25aaf52648f1e00e052f06b60 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:16 +0100 Subject: [PATCH 15/34] dexed: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/de/dexed/package.nix | 41 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/de/dexed/package.nix b/pkgs/by-name/de/dexed/package.nix index 6a699e941963..eeeea7b82555 100644 --- a/pkgs/by-name/de/dexed/package.nix +++ b/pkgs/by-name/de/dexed/package.nix @@ -53,26 +53,27 @@ stdenv.mkDerivation (finalAttrs: { libjack2 ]; - # JUCE insists on only dlopen'ing these - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux (toString [ - "-lX11" - "-lXext" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-ljack" - ]); - - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [ - # juce, compiled in this build as part of a Git submodule, uses `-flto` as - # a Link Time Optimization flag, and instructs the plugin compiled here to - # use this flag to. This breaks the build for us. Using _fat_ LTO allows - # successful linking while still providing LTO benefits. If our build of - # `juce` was used as a dependency, we could have patched that `-flto` line - # in our juce's source, but that is not possible because it is used as a - # Git Submodule. - "-ffat-lto-objects" - ]); + env = lib.optionalAttrs stdenv.hostPlatform.isLinux { + # JUCE insists on only dlopen'ing these + NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-ljack" + ]; + NIX_CFLAGS_COMPILE = toString [ + # juce, compiled in this build as part of a Git submodule, uses `-flto` as + # a Link Time Optimization flag, and instructs the plugin compiled here to + # use this flag to. This breaks the build for us. Using _fat_ LTO allows + # successful linking while still providing LTO benefits. If our build of + # `juce` was used as a dependency, we could have patched that `-flto` line + # in our juce's source, but that is not possible because it is used as a + # Git Submodule. + "-ffat-lto-objects" + ]; + }; installPhase = let From b0dc6ac6865b6807af8195a9a918113e362b8b53 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:16 +0100 Subject: [PATCH 16/34] dnstracer: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/dn/dnstracer/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/dn/dnstracer/package.nix b/pkgs/by-name/dn/dnstracer/package.nix index e065ca1dfed8..83143d0b1d37 100644 --- a/pkgs/by-name/dn/dnstracer/package.nix +++ b/pkgs/by-name/dn/dnstracer/package.nix @@ -33,7 +33,9 @@ stdenv.mkDerivation rec { buildInputs = [ ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libresolv ]; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lresolv"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-lresolv"; + }; meta = { description = "Determines where a given Domain Name Server (DNS) gets its information from, and follows the chain of DNS servers back to the servers which know the data"; From 6d05fc33db1f15124577e090aae975c75a036211 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:16 +0100 Subject: [PATCH 17/34] ecwolf: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ec/ecwolf/package.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index f0f4021405ba..91ee86673271 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -44,7 +44,12 @@ stdenv.mkDerivation (finalAttrs: { gtk3 ]; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework AppKit"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = toString [ + "-framework" + "AppKit" + ]; + }; # ECWolf installs its binary to the games/ directory, but Nix only adds bin/ # directories to the PATH. From 3158b577f3cfa470717039df9cdf32694c53e025 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:17 +0100 Subject: [PATCH 18/34] egoboo: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/eg/egoboo/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/eg/egoboo/package.nix b/pkgs/by-name/eg/egoboo/package.nix index 062188aa520f..65e54c85f8a9 100644 --- a/pkgs/by-name/eg/egoboo/package.nix +++ b/pkgs/by-name/eg/egoboo/package.nix @@ -62,12 +62,14 @@ stdenv.mkDerivation (finalAttrs: { ''; */ - # Workaround build failure on -fno-common toolchains like upstream - # gcc-10. Otherwise build fails as: - # ld: mad.o:(.bss+0x233800): multiple definition of `tile_dict'; camera.o:(.bss+0x140): first defined here - env.NIX_CFLAGS_COMPILE = "-fcommon"; + env = { + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: mad.o:(.bss+0x233800): multiple definition of `tile_dict'; camera.o:(.bss+0x140): first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; - NIX_LDFLAGS = "-lm"; + NIX_LDFLAGS = "-lm"; + }; meta = { description = "3D dungeon crawling adventure"; From 813f0487158d143bf76378acb1b230a92458da6a Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:17 +0100 Subject: [PATCH 19/34] fileshelter: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/fi/fileshelter/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/fi/fileshelter/package.nix b/pkgs/by-name/fi/fileshelter/package.nix index efbe726d82c1..f14f43ec3f30 100644 --- a/pkgs/by-name/fi/fileshelter/package.nix +++ b/pkgs/by-name/fi/fileshelter/package.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: { libarchive ]; - NIX_LDFLAGS = "-lpthread"; + env.NIX_LDFLAGS = "-lpthread"; postInstall = '' ln -s ${wt}/share/Wt/resources $out/share/fileshelter/docroot/resources From a751ac6d35ee929896c244b7897dcce15ca0d952 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:17 +0100 Subject: [PATCH 20/34] firestarter: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/fi/firestarter/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/fi/firestarter/package.nix b/pkgs/by-name/fi/firestarter/package.nix index 96574b71af6e..4ee154b6c3a2 100644 --- a/pkgs/by-name/fi/firestarter/package.nix +++ b/pkgs/by-name/fi/firestarter/package.nix @@ -98,9 +98,9 @@ stdenv.mkDerivation rec { [ glibc.static ] ); - NIX_LDFLAGS = lib.optionals withCuda [ - "-L${cudatoolkit}/lib/stubs" - ]; + env = lib.optionalAttrs withCuda { + NIX_LDFLAGS = "-L${cudatoolkit}/lib/stubs"; + }; cmakeFlags = [ "-DFIRESTARTER_BUILD_HWLOC=OFF" From cd22c1b4e771b28319e5bf028bb7d62744fda6f6 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:17 +0100 Subject: [PATCH 21/34] fuseiso: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/fu/fuseiso/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fu/fuseiso/package.nix b/pkgs/by-name/fu/fuseiso/package.nix index 3d44633beaef..5effa1a7520e 100644 --- a/pkgs/by-name/fu/fuseiso/package.nix +++ b/pkgs/by-name/fu/fuseiso/package.nix @@ -55,7 +55,10 @@ stdenv.mkDerivation rec { # after autoreconfHook, glib and zlib are not found, so force link against # them - NIX_LDFLAGS = "-lglib-2.0 -lz"; + env.NIX_LDFLAGS = toString [ + "-lglib-2.0" + "-lz" + ]; enableParallelBuilding = true; From 8d31d35af8c7c51e30e1759ef3980fcd6ae45633 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:18 +0100 Subject: [PATCH 22/34] globulation2: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/gl/globulation2/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/gl/globulation2/package.nix b/pkgs/by-name/gl/globulation2/package.nix index 7c16d0838cb6..9f4035bd64f2 100644 --- a/pkgs/by-name/gl/globulation2/package.nix +++ b/pkgs/by-name/gl/globulation2/package.nix @@ -98,7 +98,7 @@ stdenv.mkDerivation rec { "DATADIR=${placeholder "out"}/share/globulation2/glob2" ]; - NIX_LDFLAGS = "-lboost_system"; + env.NIX_LDFLAGS = "-lboost_system"; meta = { description = "RTS without micromanagement"; From 8c5da374b50b10480bc63119fd16b78b08ceb601 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:18 +0100 Subject: [PATCH 23/34] gnujump: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/gn/gnujump/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/gn/gnujump/package.nix b/pkgs/by-name/gn/gnujump/package.nix index eb079fbc81ec..db5765e101a4 100644 --- a/pkgs/by-name/gn/gnujump/package.nix +++ b/pkgs/by-name/gn/gnujump/package.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: { SDL_mixer ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; desktopItems = [ (makeDesktopItem { From 7f23170dbe404227ac59c230ce409c169a1fee99 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:18 +0100 Subject: [PATCH 24/34] golden-cheetah: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/go/golden-cheetah/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/go/golden-cheetah/package.nix b/pkgs/by-name/go/golden-cheetah/package.nix index 700d2c3b7621..cb4e9681d113 100644 --- a/pkgs/by-name/go/golden-cheetah/package.nix +++ b/pkgs/by-name/go/golden-cheetah/package.nix @@ -70,7 +70,11 @@ stdenv.mkDerivation (finalAttrs: { ./0001-Fix-building-with-bison-3.7.patch ]; - NIX_LDFLAGS = "-lz -lgsl -lblas"; + env.NIX_LDFLAGS = toString [ + "-lz" + "-lgsl" + "-lblas" + ]; qtWrapperArgs = [ "--prefix" From 286212db816f969d51b31d93bfa15c14edc69729 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:18 +0100 Subject: [PATCH 25/34] handbrake: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ha/handbrake/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ha/handbrake/package.nix b/pkgs/by-name/ha/handbrake/package.nix index d163ce04555f..ce91685cf0b2 100644 --- a/pkgs/by-name/ha/handbrake/package.nix +++ b/pkgs/by-name/ha/handbrake/package.nix @@ -305,7 +305,9 @@ let ++ optional stdenv.hostPlatform.isx86 "--harden"; # NOTE: 2018-12-27: Check NixOS HandBrake test if changing - NIX_LDFLAGS = [ "-lx265" ]; + env.NIX_LDFLAGS = toString [ + "-lx265" + ]; # meson/ninja are used only for the subprojects, not the toplevel dontUseMesonConfigure = true; From d2d44273d534d9da827b227a92240c4e6d7c77ee Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:19 +0100 Subject: [PATCH 26/34] hedgewars: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/he/hedgewars/package.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/he/hedgewars/package.nix b/pkgs/by-name/he/hedgewars/package.nix index 403e77124c23..8676d7bad743 100644 --- a/pkgs/by-name/he/hedgewars/package.nix +++ b/pkgs/by-name/he/hedgewars/package.nix @@ -78,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: { "-DNOSERVER=${if withServer then "OFF" else "ON"}" ]; - NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [ + env.NIX_LDFLAGS = lib.concatMapStringsSep " " (e: "-rpath ${e}/lib") [ SDL2.out SDL2_image SDL2_mixer @@ -93,14 +93,15 @@ stdenv.mkDerivation (finalAttrs: { ]; qtWrapperArgs = [ - "--prefix LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ - libGL - libGLU - libglut - physfs - ] - }" + "--prefix" + "LD_LIBRARY_PATH" + ":" + (lib.makeLibraryPath [ + libGL + libGLU + libglut + physfs + ]) ]; meta = { From 4423c1287dc2598b5449ce0a5eb1fa03b5e3565c Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:19 +0100 Subject: [PATCH 27/34] iay: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ia/iay/package.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ia/iay/package.nix b/pkgs/by-name/ia/iay/package.nix index 137251cffc02..3654475c1a69 100644 --- a/pkgs/by-name/ia/iay/package.nix +++ b/pkgs/by-name/ia/iay/package.nix @@ -26,10 +26,12 @@ rustPlatform.buildRustPackage rec { openssl ]; - NIX_LDFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [ - "-framework" - "AppKit" - ]; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = toString [ + "-framework" + "AppKit" + ]; + }; meta = { description = "Minimalistic, blazing-fast, and extendable prompt for bash and zsh"; From d03f49188fa1d332483997a27826e77cff782447 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:19 +0100 Subject: [PATCH 28/34] instead: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/in/instead/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/in/instead/package.nix b/pkgs/by-name/in/instead/package.nix index 3dee5046b5c1..312d04704c3f 100644 --- a/pkgs/by-name/in/instead/package.nix +++ b/pkgs/by-name/in/instead/package.nix @@ -47,7 +47,10 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-d5BvzZCZ3P5CLptuCuJ4KxfEp4CDbtmIZDIbGDcyV3o="; }; - NIX_LDFLAGS = "-llua -lgcc_s"; + env.NIX_LDFLAGS = toString [ + "-llua" + "-lgcc_s" + ]; nativeBuildInputs = [ pkg-config From 7b6003b3c848fbf3e23385f39f3b12219b9a6233 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:19 +0100 Subject: [PATCH 29/34] keepassxc: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ke/keepassxc/package.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ke/keepassxc/package.nix b/pkgs/by-name/ke/keepassxc/package.nix index 7e839cfc5d01..0971f257d978 100644 --- a/pkgs/by-name/ke/keepassxc/package.nix +++ b/pkgs/by-name/ke/keepassxc/package.nix @@ -46,13 +46,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Hec3RBC/f0GV6ZBniy+BjMAkABlg111mShrQv0aYm6g="; }; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (toString [ - "-Wno-old-style-cast" - "-Wno-error" - "-D__BIG_ENDIAN__=${if stdenv.hostPlatform.isBigEndian then "1" else "0"}" - ]); - - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-rpath ${libargon2}/lib"; + env = + lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = toString [ + "-Wno-old-style-cast" + "-Wno-error" + "-D__BIG_ENDIAN__=${if stdenv.hostPlatform.isBigEndian then "1" else "0"}" + ]; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = toString [ + "-rpath" + "${libargon2}/lib" + ]; + }; patches = [ ./darwin.patch From 1bff1b9eb3a1d59f26bb21c1d17bfdd76330eda5 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:45 +0100 Subject: [PATCH 30/34] bitcoin-knots: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/applications/blockchains/bitcoin-knots/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/blockchains/bitcoin-knots/default.nix b/pkgs/applications/blockchains/bitcoin-knots/default.nix index 2f7bb835c4f2..4c0363717c55 100644 --- a/pkgs/applications/blockchains/bitcoin-knots/default.nix +++ b/pkgs/applications/blockchains/bitcoin-knots/default.nix @@ -164,9 +164,9 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_GUI" true) ]; - NIX_LDFLAGS = lib.optionals ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic - ) "-levent_core"; + env = lib.optionalAttrs (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) { + NIX_LDFLAGS = "-levent_core"; + }; nativeCheckInputs = [ python3 ]; From d27f6e4473755341df4fd4d90f9dc4e5773e1055 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:36:55 +0100 Subject: [PATCH 31/34] bitcoin*: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/applications/blockchains/bitcoin/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix index b17fd18bdf30..858f21320109 100644 --- a/pkgs/applications/blockchains/bitcoin/default.nix +++ b/pkgs/applications/blockchains/bitcoin/default.nix @@ -165,9 +165,9 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_GUI" true) ]; - NIX_LDFLAGS = lib.optionals ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic - ) "-levent_core"; + env = lib.optionalAttrs (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) { + NIX_LDFLAGS = "-levent_core"; + }; nativeCheckInputs = [ python3 ]; From 52f80264c58cbf25d0670c2521d4a01228f72091 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:37:03 +0100 Subject: [PATCH 32/34] cudatext: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/applications/editors/cudatext/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/cudatext/default.nix b/pkgs/applications/editors/cudatext/default.nix index 15188aa9f1ac..4de19aba280e 100644 --- a/pkgs/applications/editors/cudatext/default.nix +++ b/pkgs/applications/editors/cudatext/default.nix @@ -81,7 +81,11 @@ stdenv.mkDerivation rec { ++ lib.optional (widgetset == "gtk3") gtk3 ++ lib.optional (widgetset == "qt5") libsForQt5.libqtpas; - NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + env.NIX_LDFLAGS = toString [ + "--as-needed" + "-rpath" + (lib.makeLibraryPath buildInputs) + ]; buildPhase = lib.concatStringsSep "\n" ( From 7c13b38779efcd06da8e9c3197f1b7243bf4b9e7 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:37:10 +0100 Subject: [PATCH 33/34] dino: move NIX_LDFLAGS into env for structuredAttrs --- .../networking/instant-messengers/dino/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/dino/default.nix b/pkgs/applications/networking/instant-messengers/dino/default.nix index 33aa661cd634..f3b68cfcd1c2 100644 --- a/pkgs/applications/networking/instant-messengers/dino/default.nix +++ b/pkgs/applications/networking/instant-messengers/dino/default.nix @@ -87,7 +87,9 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; # Undefined symbols for architecture arm64: "_gpg_strerror" - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lgpg-error"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-lgpg-error"; + }; # Dino looks for plugins with a .so filename extension, even on macOS where # .dylib is appropriate, and despite the fact that it builds said plugins with From 887559386dc3a1c7b747cde688904ce92bb932d3 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 30 Jan 2026 23:37:36 +0100 Subject: [PATCH 34/34] apacheHttpd: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/servers/http/apache-httpd/2.4.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix index 762aa9a757dc..0fdcd9c680ab 100644 --- a/pkgs/servers/http/apache-httpd/2.4.nix +++ b/pkgs/servers/http/apache-httpd/2.4.nix @@ -86,7 +86,9 @@ stdenv.mkDerivation rec { ''; # Required for ‘pthread_cancel’. - NIX_LDFLAGS = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-lgcc_s"; + env = lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) { + NIX_LDFLAGS = "-lgcc_s"; + }; configureFlags = [ "--with-apr=${apr.dev}"