From c8674759bbceb4758286e2437cf644e99d829502 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:29 +0100 Subject: [PATCH 01/25] pax: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/pa/pax/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/pa/pax/package.nix b/pkgs/by-name/pa/pax/package.nix index bf38bcd5c4b6..b63849172338 100644 --- a/pkgs/by-name/pa/pax/package.nix +++ b/pkgs/by-name/pa/pax/package.nix @@ -16,7 +16,9 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = lib.optional stdenv.hostPlatform.isMusl musl-fts; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts"; + env = lib.optionalAttrs stdenv.hostPlatform.isMusl { + NIX_LDFLAGS = "-lfts"; + }; buildPhase = '' sh Build.sh -r -tpax From bb2fe6d6c69055d905a30683d36a5de92e738a1d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:29 +0100 Subject: [PATCH 02/25] phash: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ph/phash/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ph/phash/package.nix b/pkgs/by-name/ph/phash/package.nix index 656a89b2e832..3e9e961d2941 100644 --- a/pkgs/by-name/ph/phash/package.nix +++ b/pkgs/by-name/ph/phash/package.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-frISiZ89ei7XfI5F2nJJehfQZsk0Mlb4n91q/AiZ2vA="; }; - NIX_LDFLAGS = "-lfftw3_threads"; + env.NIX_LDFLAGS = "-lfftw3_threads"; patches = [ # proper pthread return value (https://github.com/clearscene/pHash/pull/20) From 659f09278ff0183e868d5afe4b1f35b99e07c9b9 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:29 +0100 Subject: [PATCH 03/25] phodav: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ph/phodav/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ph/phodav/package.nix b/pkgs/by-name/ph/phodav/package.nix index a5bb57ae66d0..c965f5856213 100644 --- a/pkgs/by-name/ph/phodav/package.nix +++ b/pkgs/by-name/ph/phodav/package.nix @@ -45,7 +45,9 @@ stdenv.mkDerivation rec { "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d" ]; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lintl"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-lintl"; + }; doInstallCheck = true; From a01f8e172ad95c32b176359ff5bd383cfb513d6a Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:30 +0100 Subject: [PATCH 04/25] pktgen: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/pk/pktgen/package.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/pk/pktgen/package.nix b/pkgs/by-name/pk/pktgen/package.nix index bfb3aa43a347..2c7cf0cc9f32 100644 --- a/pkgs/by-name/pk/pktgen/package.nix +++ b/pkgs/by-name/pk/pktgen/package.nix @@ -45,15 +45,16 @@ stdenv.mkDerivation (finalAttrs: { gtk2 ]; - RTE_SDK = dpdk; - GUI = lib.optionalString withGtk "true"; + env = { + RTE_SDK = dpdk; + GUI = lib.optionalString withGtk "true"; - env.NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=sign-compare" - ]; - - # requires symbols from this file - NIX_LDFLAGS = "-lrte_net_bond"; + NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=sign-compare" + ]; + # requires symbols from this file + NIX_LDFLAGS = "-lrte_net_bond"; + }; postPatch = '' substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${util-linux}/bin/lscpu From fc1fc38c553bc807b05bd3a81f55a6a4b3c008aa Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:30 +0100 Subject: [PATCH 05/25] plugdata: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/pl/plugdata/package.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/pl/plugdata/package.nix b/pkgs/by-name/pl/plugdata/package.nix index 66d9c571e179..d64452d3c066 100644 --- a/pkgs/by-name/pl/plugdata/package.nix +++ b/pkgs/by-name/pl/plugdata/package.nix @@ -92,18 +92,16 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; patches = [ # fiddle~.c prevents building with gcc15. Upstream puredata has fixed this issue, From 78c3ec699b1ab369c5f945785ed32583250bbedc Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:30 +0100 Subject: [PATCH 06/25] postfix: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/po/postfix/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/po/postfix/package.nix b/pkgs/by-name/po/postfix/package.nix index 8cbd827770bc..0989e9622ef7 100644 --- a/pkgs/by-name/po/postfix/package.nix +++ b/pkgs/by-name/po/postfix/package.nix @@ -147,7 +147,9 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - NIX_LDFLAGS = lib.optionalString withLDAP "-llber"; + env = lib.optionalAttrs withLDAP { + NIX_LDFLAGS = "-llber"; + }; installTargets = [ "non-interactive-package" ]; From 148b955ded491e19ccf0cb904a05fde63c76a475 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:30 +0100 Subject: [PATCH 07/25] ppp: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/pp/ppp/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/pp/ppp/package.nix b/pkgs/by-name/pp/ppp/package.nix index a4c577d4c015..547c7ee8f7dd 100644 --- a/pkgs/by-name/pp/ppp/package.nix +++ b/pkgs/by-name/pp/ppp/package.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: { "CC=${stdenv.cc.targetPrefix}cc" ]; - NIX_LDFLAGS = "-lcrypt"; + env.NIX_LDFLAGS = "-lcrypt"; installFlags = [ "sysconfdir=$(out)/etc" From 229b31ed703a2a1751cc2b80ac26a715c615f5a9 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:31 +0100 Subject: [PATCH 08/25] qtgreet: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/qt/qtgreet/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/qt/qtgreet/package.nix b/pkgs/by-name/qt/qtgreet/package.nix index 508e4a5f4d23..497777b37023 100644 --- a/pkgs/by-name/qt/qtgreet/package.nix +++ b/pkgs/by-name/qt/qtgreet/package.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonOption "dynpath" "${placeholder "out"}/var/lib/qtgreet") ]; - NIX_LDFLAGS = "-lwayqt-utils-qt6"; + env.NIX_LDFLAGS = "-lwayqt-utils-qt6"; meta = { description = "Qt based greeter for greetd, to be run under wayfire or similar wlr-based compositors"; From 84d8b53d8abd2cf761fde3f0e5578126fb502b45 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:31 +0100 Subject: [PATCH 09/25] ripplerx: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ri/ripplerx/package.nix | 42 +++++++++++++++------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ri/ripplerx/package.nix b/pkgs/by-name/ri/ripplerx/package.nix index 670b2cff797d..edbc55fd9a41 100644 --- a/pkgs/by-name/ri/ripplerx/package.nix +++ b/pkgs/by-name/ri/ripplerx/package.nix @@ -52,28 +52,30 @@ stdenv.mkDerivation (finalAttrs: { libXrandr ]; - # JUCE dlopens these at runtime, standalone executable crashes without them - NIX_LDFLAGS = [ - "-lX11" - "-lXext" - "-lXcursor" - "-lXinerama" - "-lXrandr" - ]; + env = { + # JUCE dlopens these at runtime, standalone executable crashes without them + NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcursor" + "-lXinerama" + "-lXrandr" + ]; - env.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" - ]; + 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" + ]; - # Fontconfig error: Cannot load default config file: No such file: (null) - env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; + # Fontconfig error: Cannot load default config file: No such file: (null) + FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; + }; installPhase = '' runHook preInstall From b2403c6ba00b31a6c7d226570735e5a96fd854b9 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:31 +0100 Subject: [PATCH 10/25] rox-filer: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/ro/rox-filer/package.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ro/rox-filer/package.nix b/pkgs/by-name/ro/rox-filer/package.nix index 6a71a3a856eb..5e362ccdaef9 100644 --- a/pkgs/by-name/ro/rox-filer/package.nix +++ b/pkgs/by-name/ro/rox-filer/package.nix @@ -30,8 +30,11 @@ stdenv.mkDerivation (finalAttrs: { shared-mime-info libSM ]; - NIX_LDFLAGS = "-lm"; - NIX_CFLAGS_COMPILE = " -fpermissive"; + + env = { + NIX_LDFLAGS = "-lm"; + NIX_CFLAGS_COMPILE = "-fpermissive"; + }; patches = [ ./rox-filer-2.11-in-source-build.patch From cdc7c59269f6bb111cb517d46c2cb74c35001433 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:31 +0100 Subject: [PATCH 11/25] scorched3d: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/sc/scorched3d/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/sc/scorched3d/package.nix b/pkgs/by-name/sc/scorched3d/package.nix index 0df07831a439..8d781d15d676 100644 --- a/pkgs/by-name/sc/scorched3d/package.nix +++ b/pkgs/by-name/sc/scorched3d/package.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--with-fftw=${fftwSinglePrec.dev}" ]; - NIX_LDFLAGS = "-lopenal"; + env.NIX_LDFLAGS = "-lopenal"; meta = { homepage = "http://scorched3d.co.uk/"; From 9c968c4c2d8e05191549aa8ed78d84666371ef86 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:32 +0100 Subject: [PATCH 12/25] siege: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/si/siege/package.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/si/siege/package.nix b/pkgs/by-name/si/siege/package.nix index c3e5901b6477..0e074b880f96 100644 --- a/pkgs/by-name/si/siege/package.nix +++ b/pkgs/by-name/si/siege/package.nix @@ -15,9 +15,14 @@ stdenv.mkDerivation rec { hash = "sha256-7BQM7dFZl5OD1g2+h6AVHCwSraeHkQlaj6hK5jW5MCY="; }; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux [ - "-lgcc_s" - ]; + env = + lib.optionalAttrs stdenv.hostPlatform.isLinux { + NIX_LDFLAGS = toString [ "-lgcc_s" ]; + } + // lib.optionalAttrs stdenv.cc.isClang { + # Borrowed solution from homebrew: https://github.com/Homebrew/homebrew-core/blob/1c7c95183c0984a84b1680422afab6578c300a27/Formula/s/siege.rb#L31 + CFLAGS = "-Wno-int-conversion"; + }; buildInputs = [ openssl @@ -33,9 +38,6 @@ stdenv.mkDerivation rec { "--with-zlib=${zlib.dev}" ]; - # Borrowed solution from homebrew: https://github.com/Homebrew/homebrew-core/blob/1c7c95183c0984a84b1680422afab6578c300a27/Formula/s/siege.rb#L31 - CFLAGS = lib.optionalString stdenv.cc.isClang "-Wno-int-conversion"; - meta = { description = "HTTP load tester"; homepage = "https://www.joedog.org/siege-home/"; From d7f1ffa4710b2466e080684c7bdff8813c2e8adf Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:32 +0100 Subject: [PATCH 13/25] siesta: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/si/siesta/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/si/siesta/package.nix b/pkgs/by-name/si/siesta/package.nix index 36a6c07e3b82..7c6dd18d31c0 100644 --- a/pkgs/by-name/si/siesta/package.nix +++ b/pkgs/by-name/si/siesta/package.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { scalapack ]; - NIX_LDFLAGS = "-lm"; + env.NIX_LDFLAGS = "-lm"; cmakeFlags = [ "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" From adc97605677b9ae8d1741639d733d341f6dd9982 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:32 +0100 Subject: [PATCH 14/25] silver-searcher: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/si/silver-searcher/package.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/si/silver-searcher/package.nix b/pkgs/by-name/si/silver-searcher/package.nix index 87151fd393e2..6015d39697c6 100644 --- a/pkgs/by-name/si/silver-searcher/package.nix +++ b/pkgs/by-name/si/silver-searcher/package.nix @@ -22,13 +22,17 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./bash-completion.patch ]; - # Workaround build failure on -fno-common toolchains like upstream - # gcc-10. Otherwise build fails as: - # ld: src/zfile.o:/build/source/src/log.h:12: multiple definition of - # `print_mtx'; src/ignore.o:/build/source/src/log.h:12: first defined here - # TODO: remove once next release has https://github.com/ggreer/the_silver_searcher/pull/1377 - env.NIX_CFLAGS_COMPILE = "-fcommon"; - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-lgcc_s"; + env = { + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: src/zfile.o:/build/source/src/log.h:12: multiple definition of + # `print_mtx'; src/ignore.o:/build/source/src/log.h:12: first defined here + # TODO: remove once next release has https://github.com/ggreer/the_silver_searcher/pull/1377 + NIX_CFLAGS_COMPILE = "-fcommon"; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + NIX_LDFLAGS = "-lgcc_s"; + }; nativeBuildInputs = [ autoreconfHook From 8ef3430dee814b7a3d8fa52ff8ce051fb9bc06c5 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:32 +0100 Subject: [PATCH 15/25] smpeg: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/sm/smpeg/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sm/smpeg/package.nix b/pkgs/by-name/sm/smpeg/package.nix index c25a0c09ad77..53b2612f4e46 100644 --- a/pkgs/by-name/sm/smpeg/package.nix +++ b/pkgs/by-name/sm/smpeg/package.nix @@ -93,7 +93,9 @@ stdenv.mkDerivation (finalAttrs: { --prefix PKG_CONFIG_PATH ":" "${lib.getDev SDL}/lib/pkgconfig" ''; - NIX_LDFLAGS = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-lX11"; + env = lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) { + NIX_LDFLAGS = "-lX11"; + }; meta = { homepage = "https://icculus.org/smpeg/"; From 7945d03e81f21e6081f26bd7bc08b8430b1e91d6 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:33 +0100 Subject: [PATCH 16/25] socalabs-papu: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/so/socalabs-papu/package.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/so/socalabs-papu/package.nix b/pkgs/by-name/so/socalabs-papu/package.nix index 31632fc4ee2c..70ca9f7137e3 100644 --- a/pkgs/by-name/so/socalabs-papu/package.nix +++ b/pkgs/by-name/so/socalabs-papu/package.nix @@ -120,18 +120,16 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = nix-update-script { }; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; meta = { description = "Socalabs Nintendo Gameboy PAPU Emulation Plugin"; From 3fb133de9bbce371038a4790188f640b1ff77b1d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:33 +0100 Subject: [PATCH 17/25] socalabs-rp2a03: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/so/socalabs-rp2a03/package.nix | 22 ++++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/so/socalabs-rp2a03/package.nix b/pkgs/by-name/so/socalabs-rp2a03/package.nix index 64b38d9c86f0..7bee247d80ac 100644 --- a/pkgs/by-name/so/socalabs-rp2a03/package.nix +++ b/pkgs/by-name/so/socalabs-rp2a03/package.nix @@ -117,18 +117,16 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; meta = { description = "Socalabs NES Ricoh 2A03 Emulation Plugin"; From 514ea834239baeebcc830f719f26a21b332caf33 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:33 +0100 Subject: [PATCH 18/25] socalabs-sid: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/so/socalabs-sid/package.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/so/socalabs-sid/package.nix b/pkgs/by-name/so/socalabs-sid/package.nix index bc9a6d7dcdaf..792b529a75b4 100644 --- a/pkgs/by-name/so/socalabs-sid/package.nix +++ b/pkgs/by-name/so/socalabs-sid/package.nix @@ -152,18 +152,16 @@ stdenv.mkDerivation { runHook postInstall ''; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; meta = { description = "Socalabs Commodore 64 SID Emulation Plugin"; From 18ec23d359cbb58d943363d1a3a6b4245e1549d4 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:33 +0100 Subject: [PATCH 19/25] socalabs-sn76489: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/so/socalabs-sn76489/package.nix | 22 +++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/so/socalabs-sn76489/package.nix b/pkgs/by-name/so/socalabs-sn76489/package.nix index aaf32ae6a205..a54c6b796bc2 100644 --- a/pkgs/by-name/so/socalabs-sn76489/package.nix +++ b/pkgs/by-name/so/socalabs-sn76489/package.nix @@ -127,18 +127,16 @@ stdenv.mkDerivation { runHook postInstall ''; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; passthru.updateScript = nix-update-script { }; From d8ae82178296ff31963302cec9fb2eebbcb519fd Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:34 +0100 Subject: [PATCH 20/25] socalabs-voc: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/so/socalabs-voc/package.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/so/socalabs-voc/package.nix b/pkgs/by-name/so/socalabs-voc/package.nix index 3de5e6148c9c..3be3fdd55677 100644 --- a/pkgs/by-name/so/socalabs-voc/package.nix +++ b/pkgs/by-name/so/socalabs-voc/package.nix @@ -130,18 +130,16 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcomposite" - "-lXcursor" - "-lXinerama" - "-lXrandr" - "-lXtst" - "-lXdmcp" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcomposite" + "-lXcursor" + "-lXinerama" + "-lXrandr" + "-lXtst" + "-lXdmcp" + ]; passthru.updateScript = nix-update-script { }; From 95fa78dc23c697f548a55d96f92f4b6704ccc773 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:34 +0100 Subject: [PATCH 21/25] surge-XT: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/su/surge-XT/package.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/su/surge-XT/package.nix b/pkgs/by-name/su/surge-XT/package.nix index 82ec458255eb..daee093f35c0 100644 --- a/pkgs/by-name/su/surge-XT/package.nix +++ b/pkgs/by-name/su/surge-XT/package.nix @@ -77,15 +77,13 @@ stdenv.mkDerivation (finalAttrs: { ]; # JUCE dlopen's these at runtime, crashes without them - NIX_LDFLAGS = ( - toString [ - "-lX11" - "-lXext" - "-lXcursor" - "-lXinerama" - "-lXrandr" - ] - ); + env.NIX_LDFLAGS = toString [ + "-lX11" + "-lXext" + "-lXcursor" + "-lXinerama" + "-lXrandr" + ]; passthru = { rev-prefix = "release_xt_"; From 38791474f57a8968637d27e70f1016723bf8436d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:34 +0100 Subject: [PATCH 22/25] svnfs: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/sv/svnfs/package.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/sv/svnfs/package.nix b/pkgs/by-name/sv/svnfs/package.nix index 2c07913c63d2..d955b25b5a41 100644 --- a/pkgs/by-name/sv/svnfs/package.nix +++ b/pkgs/by-name/sv/svnfs/package.nix @@ -41,12 +41,20 @@ stdenv.mkDerivation (finalAttrs: { export LD_LIBRARY_PATH=${subversion.out}/lib ''; - # -fcommon: workaround build failure on -fno-common toolchains like upstream - # gcc-10. Otherwise build fails as: - # ld: svnclient.o:/build/svnfs-0.4/src/svnfs.h:40: multiple definition of - # `dirbuf'; svnfs.o:/build/svnfs-0.4/src/svnfs.h:40: first defined here - env.NIX_CFLAGS_COMPILE = "-I ${subversion.dev}/include/subversion-1 -fcommon"; - NIX_LDFLAGS = "-lsvn_client-1 -lsvn_subr-1"; + env = { + # -fcommon: workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: svnclient.o:/build/svnfs-0.4/src/svnfs.h:40: multiple definition of + # `dirbuf'; svnfs.o:/build/svnfs-0.4/src/svnfs.h:40: first defined here + NIX_CFLAGS_COMPILE = toString [ + "-I ${subversion.dev}/include/subversion-1" + "-fcommon" + ]; + NIX_LDFLAGS = toString [ + "-lsvn_client-1" + "-lsvn_subr-1" + ]; + }; meta = { description = "FUSE filesystem for accessing Subversion repositories"; From 981963070b5822dc72e23f0e5ec3217fb05c7470 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:23:34 +0100 Subject: [PATCH 23/25] sylpheed: move NIX_LDFLAGS into env for structuredAttrs --- pkgs/by-name/sy/sylpheed/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sy/sylpheed/package.nix b/pkgs/by-name/sy/sylpheed/package.nix index f6149e7e9b6f..f30cee26dba6 100644 --- a/pkgs/by-name/sy/sylpheed/package.nix +++ b/pkgs/by-name/sy/sylpheed/package.nix @@ -54,7 +54,9 @@ stdenv.mkDerivation rec { configureFlags = lib.optional gpgSupport "--enable-gpgme" ++ lib.optional sslSupport "--enable-ssl"; # Undefined symbols for architecture arm64: "_OBJC_CLASS_$_NSAutoreleasePool" - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework Foundation"; + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-framework Foundation"; + }; meta = { homepage = "https://sylpheed.sraoss.jp/en/"; From 80982d0457373a4c31c4eb378488d7857fc1ea38 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:24:09 +0100 Subject: [PATCH 24/25] prusa-slicer/super-slicer: move NIX_LDFLAGS into env for structuredAttrs --- .../misc/prusa-slicer/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 830601e189cf..6309889d9d91 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -145,14 +145,17 @@ stdenv.mkDerivation (finalAttrs: { doInstallCheck = true; - # The build system uses custom logic - defined in - # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt - # library, which doesn't pick up the package in the nix store. We - # additionally need to set the path via the NLOPT environment variable. - NLOPT = nlopt; - - # prusa-slicer uses dlopen on `libudev.so` at runtime - NIX_LDFLAGS = lib.optionalString withSystemd "-ludev"; + env = { + # The build system uses custom logic - defined in + # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt + # library, which doesn't pick up the package in the nix store. We + # additionally need to set the path via the NLOPT environment variable. + NLOPT = nlopt; + } + // lib.optionalAttrs withSystemd { + # prusa-slicer uses dlopen on `libudev.so` at runtime + NIX_LDFLAGS = "-ludev"; + }; prePatch = '' # Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx From 1657ac59f166b86cb07bfc3b0397a6a719b1578b Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 1 Feb 2026 23:24:25 +0100 Subject: [PATCH 25/25] svn-all-fast-export: move NIX_LDFLAGS into env for structuredAttrs --- .../version-management/svn-all-fast-export/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/svn-all-fast-export/default.nix b/pkgs/applications/version-management/svn-all-fast-export/default.nix index d62d83c117ab..71b450f442bb 100644 --- a/pkgs/applications/version-management/svn-all-fast-export/default.nix +++ b/pkgs/applications/version-management/svn-all-fast-export/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation { "SVN_INCLUDE=${subversion.dev}/include/subversion-1" ]; - NIX_LDFLAGS = "-lsvn_fs-1"; + env.NIX_LDFLAGS = "-lsvn_fs-1"; dontWrapQtApps = true;