From a55b911b56527e46a3d2198f19a843fae822c3c7 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 8 Jan 2026 10:37:20 +0300 Subject: [PATCH] Revert "treewide: prepare Rust packages for structuredAttrs by putting variables in env" --- pkgs/by-name/ai/airshipper/package.nix | 2 +- pkgs/by-name/ce/celeste/package.nix | 2 +- pkgs/by-name/cn/cnsprcy/package.nix | 2 +- pkgs/by-name/ew/eww/package.nix | 2 +- pkgs/by-name/fr/freshfetch/package.nix | 2 +- pkgs/by-name/fu/fuc/package.nix | 2 +- .../hi/highlight-assertions/package.nix | 2 +- pkgs/by-name/ho/holo-cli/package.nix | 2 +- pkgs/by-name/ho/holo-daemon/package.nix | 2 +- pkgs/by-name/id/idmail/package.nix | 6 ++--- pkgs/by-name/ki/kind2/package.nix | 2 +- pkgs/by-name/ko/kord/package.nix | 2 +- pkgs/by-name/ms/msedit/package.nix | 18 ++++++--------- pkgs/by-name/ni/nix-ld/package.nix | 6 ++--- pkgs/by-name/sh/shadow-tls/package.nix | 2 +- pkgs/by-name/sy/syndicate-server/package.nix | 2 +- pkgs/by-name/un/unpfs/package.nix | 2 +- pkgs/development/compilers/rust/cargo.nix | 22 +++++++++---------- pkgs/development/compilers/rust/clippy.nix | 2 +- pkgs/development/compilers/rust/rustfmt.nix | 14 +++++------- .../mitmproxy-linux/default.nix | 6 ++--- 21 files changed, 45 insertions(+), 57 deletions(-) diff --git a/pkgs/by-name/ai/airshipper/package.nix b/pkgs/by-name/ai/airshipper/package.nix index 4731be7ce016..aba284758545 100644 --- a/pkgs/by-name/ai/airshipper/package.nix +++ b/pkgs/by-name/ai/airshipper/package.nix @@ -87,7 +87,7 @@ rustPlatform.buildRustPackage { makeWrapper ]; - env.RUSTC_BOOTSTRAP = 1; # We need rust unstable features + RUSTC_BOOTSTRAP = 1; # We need rust unstable features postInstall = '' install -Dm444 -t "$out/share/applications" "client/assets/net.veloren.airshipper.desktop" diff --git a/pkgs/by-name/ce/celeste/package.nix b/pkgs/by-name/ce/celeste/package.nix index e3535bf41e09..911d3f54429a 100644 --- a/pkgs/by-name/ce/celeste/package.nix +++ b/pkgs/by-name/ce/celeste/package.nix @@ -54,7 +54,7 @@ rustPlatform.buildRustPackage rec { --replace-warn 'edition = "2021"' 'edition = "2024"' ''; - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; nativeBuildInputs = [ just diff --git a/pkgs/by-name/cn/cnsprcy/package.nix b/pkgs/by-name/cn/cnsprcy/package.nix index 4e4f8778bef4..662df4a1f5ca 100644 --- a/pkgs/by-name/cn/cnsprcy/package.nix +++ b/pkgs/by-name/cn/cnsprcy/package.nix @@ -22,7 +22,7 @@ rustPlatform.buildRustPackage (finalAttrs: { passthru.updateScript = ./update.sh; - env.RUSTC_BOOTSTRAP = true; + RUSTC_BOOTSTRAP = true; buildInputs = [ sqlite ]; meta = { diff --git a/pkgs/by-name/ew/eww/package.nix b/pkgs/by-name/ew/eww/package.nix index 8656401e6a45..9f8739ea741f 100644 --- a/pkgs/by-name/ew/eww/package.nix +++ b/pkgs/by-name/ew/eww/package.nix @@ -47,7 +47,7 @@ rustPlatform.buildRustPackage rec { cargoTestFlags = cargoBuildFlags; # requires unstable rust features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd eww \ diff --git a/pkgs/by-name/fr/freshfetch/package.nix b/pkgs/by-name/fr/freshfetch/package.nix index d61bbb398d22..dd6b7510d7b9 100644 --- a/pkgs/by-name/fr/freshfetch/package.nix +++ b/pkgs/by-name/fr/freshfetch/package.nix @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-LKltHVig33zUSWoRgCb1BgeKiJsDnlYEuPfQfrnhafI="; # freshfetch depends on rust nightly features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; meta = { description = "Fresh take on neofetch"; diff --git a/pkgs/by-name/fu/fuc/package.nix b/pkgs/by-name/fu/fuc/package.nix index bb6632c0f710..6175f66772b3 100644 --- a/pkgs/by-name/fu/fuc/package.nix +++ b/pkgs/by-name/fu/fuc/package.nix @@ -19,7 +19,7 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-OoTWGeF96BpPDx1Y9AEVOIBK7kCz6pjw24pLiNcKmOc="; - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; cargoBuildFlags = [ "--workspace" diff --git a/pkgs/by-name/hi/highlight-assertions/package.nix b/pkgs/by-name/hi/highlight-assertions/package.nix index 4f03a55c63a6..50d48e31db33 100644 --- a/pkgs/by-name/hi/highlight-assertions/package.nix +++ b/pkgs/by-name/hi/highlight-assertions/package.nix @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-egrxcnDVKKgk1sL5WNMIR2FPwQbjjMy20VWizcTBEtM="; # requires nightly features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; meta = { description = "Tool for unit testing tree sitter highlights for nvim-treesitter"; diff --git a/pkgs/by-name/ho/holo-cli/package.nix b/pkgs/by-name/ho/holo-cli/package.nix index e3efcf600528..44dc53470480 100644 --- a/pkgs/by-name/ho/holo-cli/package.nix +++ b/pkgs/by-name/ho/holo-cli/package.nix @@ -24,7 +24,7 @@ rustPlatform.buildRustPackage (finalAttrs: { passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; # Use rust nightly features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/ho/holo-daemon/package.nix b/pkgs/by-name/ho/holo-daemon/package.nix index 10b86b93b7a1..c71f737c54f8 100644 --- a/pkgs/by-name/ho/holo-daemon/package.nix +++ b/pkgs/by-name/ho/holo-daemon/package.nix @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-YZ2c6W6CCqgyN+6i7Vh5fWLKw8L4pUqvq/tDO/Q/kf0="; # Use rust nightly features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/id/idmail/package.nix b/pkgs/by-name/id/idmail/package.nix index 41b05845bccf..7c955fd469d1 100644 --- a/pkgs/by-name/id/idmail/package.nix +++ b/pkgs/by-name/id/idmail/package.nix @@ -34,10 +34,8 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-UcS2gAoa2fzPu6hh8I5sXSHHbAmzsecT44Ju2CVsK0Q="; - env = { - RUSTC_BOOTSTRAP = 1; - RUSTFLAGS = "--cfg=web_sys_unstable_apis"; - }; + RUSTC_BOOTSTRAP = 1; + RUSTFLAGS = "--cfg=web_sys_unstable_apis"; nativeBuildInputs = [ wasm-bindgen-cli_0_2_100 diff --git a/pkgs/by-name/ki/kind2/package.nix b/pkgs/by-name/ki/kind2/package.nix index c571fd6d0058..34ae627b4597 100644 --- a/pkgs/by-name/ki/kind2/package.nix +++ b/pkgs/by-name/ki/kind2/package.nix @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec { ''; # requires nightly features - env.RUSTC_BOOTSTRAP = true; + RUSTC_BOOTSTRAP = true; meta = { description = "Functional programming language and proof assistant"; diff --git a/pkgs/by-name/ko/kord/package.nix b/pkgs/by-name/ko/kord/package.nix index 682215044f71..ad3862b6f54f 100644 --- a/pkgs/by-name/ko/kord/package.nix +++ b/pkgs/by-name/ko/kord/package.nix @@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec { version = "0.6.1"; # kord depends on nightly features - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; src = fetchFromGitHub { owner = "twitchax"; diff --git a/pkgs/by-name/ms/msedit/package.nix b/pkgs/by-name/ms/msedit/package.nix index 3319b3e30d9a..8b9a2ed13745 100644 --- a/pkgs/by-name/ms/msedit/package.nix +++ b/pkgs/by-name/ms/msedit/package.nix @@ -19,18 +19,14 @@ rustPlatform.buildRustPackage (finalAttrs: { }; cargoHash = "sha256-U8U70nzTmpY6r8J661EJ4CGjx6vWrGovu5m25dvz5sY="; - # Requires nightly features - env = { - RUSTC_BOOTSTRAP = 1; - # Without -headerpad, the following error occurs on x86_64-darwin - # error: install_name_tool: changing install names or rpaths can't be redone for: ... because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) - NIX_LDFLAGS = toString ( - lib.optionals (with stdenv.hostPlatform; isDarwin && isx86_64) [ - "-headerpad_max_install_names" - ] - ); - }; + env.RUSTC_BOOTSTRAP = 1; + + # Without -headerpad, the following error occurs on x86_64-darwin + # error: install_name_tool: changing install names or rpaths can't be redone for: ... because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) + NIX_LDFLAGS = lib.optionals (with stdenv.hostPlatform; isDarwin && isx86_64) [ + "-headerpad_max_install_names" + ]; buildInputs = [ icu diff --git a/pkgs/by-name/ni/nix-ld/package.nix b/pkgs/by-name/ni/nix-ld/package.nix index 8290aaa03212..3c69baf06241 100644 --- a/pkgs/by-name/ni/nix-ld/package.nix +++ b/pkgs/by-name/ni/nix-ld/package.nix @@ -21,10 +21,8 @@ rustPlatform.buildRustPackage rec { hardeningDisable = [ "stackprotector" ]; - env = { - NIX_SYSTEM = stdenv.system; - RUSTC_BOOTSTRAP = "1"; - }; + NIX_SYSTEM = stdenv.system; + RUSTC_BOOTSTRAP = "1"; preCheck = '' export NIX_LD=${stdenv.cc.bintools.dynamicLinker} diff --git a/pkgs/by-name/sh/shadow-tls/package.nix b/pkgs/by-name/sh/shadow-tls/package.nix index f985456e6329..960372fdf6b5 100644 --- a/pkgs/by-name/sh/shadow-tls/package.nix +++ b/pkgs/by-name/sh/shadow-tls/package.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-1oJCdqBa1pWpQ7QvZ0vZaOd73R+SzR9OPf+yoI+RwCY="; - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; # network required doCheck = false; diff --git a/pkgs/by-name/sy/syndicate-server/package.nix b/pkgs/by-name/sy/syndicate-server/package.nix index 4f6219b3596a..025b446e0e81 100644 --- a/pkgs/by-name/sy/syndicate-server/package.nix +++ b/pkgs/by-name/sy/syndicate-server/package.nix @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec { ]; buildInputs = [ openssl ]; - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; doCheck = false; doInstallCheck = true; diff --git a/pkgs/by-name/un/unpfs/package.nix b/pkgs/by-name/un/unpfs/package.nix index 99d7d9662bdf..4cf96dbdd0de 100644 --- a/pkgs/by-name/un/unpfs/package.nix +++ b/pkgs/by-name/un/unpfs/package.nix @@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-jRe1lgzfhzBUsS6wwwlqxxomap2TIDOyF3YBv20GJ14="; - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; postInstall = '' install -D -m 0444 ../../README* -t "$out/share/doc/${pname}" diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 4cd12db0b152..42dd8bc59971 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -55,19 +55,19 @@ rustPlatform.buildRustPackage.override zlib ]; - env = { - # cargo uses git-rs which is made for a version of libgit2 from recent master that - # is not compatible with the current version in nixpkgs. - #LIBGIT2_SYS_USE_PKG_CONFIG = 1; + # cargo uses git-rs which is made for a version of libgit2 from recent master that + # is not compatible with the current version in nixpkgs. + #LIBGIT2_SYS_USE_PKG_CONFIG = 1; - # fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel - RUSTC_BOOTSTRAP = 1; + # fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel + RUSTC_BOOTSTRAP = 1; - } - // lib.optionalAttrs (stdenv.hostPlatform.rust.rustcTargetSpec == "x86_64-unknown-linux-gnu") { - # Upstream defaults to lld on x86_64-unknown-linux-gnu, we want to use our linker - RUSTFLAGS = "-Clinker-features=-lld -Clink-self-contained=-linker"; - }; + RUSTFLAGS = + if stdenv.hostPlatform.rust.rustcTargetSpec == "x86_64-unknown-linux-gnu" then + # Upstream defaults to lld on x86_64-unknown-linux-gnu, we want to use our linker + "-Clinker-features=-lld -Clink-self-contained=-linker" + else + null; postInstall = '' wrapProgram "$out/bin/cargo" --suffix PATH : "${rustc}/bin" diff --git a/pkgs/development/compilers/rust/clippy.nix b/pkgs/development/compilers/rust/clippy.nix index e5f1b3544f0b..fa33c9e9f315 100644 --- a/pkgs/development/compilers/rust/clippy.nix +++ b/pkgs/development/compilers/rust/clippy.nix @@ -21,7 +21,7 @@ rustPlatform.buildRustPackage { buildInputs = [ rustc.llvm ]; # fixes: error: the option `Z` is only accepted on the nightly compiler - env.RUSTC_BOOTSTRAP = 1; + RUSTC_BOOTSTRAP = 1; # Without disabling the test the build fails with: # error: failed to run custom build command for `rustc_llvm v0.0.0 diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix index 0398dcc9fe0a..b002d665518a 100644 --- a/pkgs/development/compilers/rust/rustfmt.nix +++ b/pkgs/development/compilers/rust/rustfmt.nix @@ -38,15 +38,13 @@ rustPlatform.buildRustPackage { install_name_tool -add_rpath "${rustc.unwrapped}/lib" "$out/bin/git-rustfmt" ''; - env = { - # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler - RUSTC_BOOTSTRAP = 1; + # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler + RUSTC_BOOTSTRAP = 1; - # As of rustc 1.45.0, these env vars are required to build rustfmt (due to - # https://github.com/rust-lang/rust/pull/72001) - CFG_RELEASE = rustc.version; - CFG_RELEASE_CHANNEL = if asNightly then "nightly" else "stable"; - }; + # As of rustc 1.45.0, these env vars are required to build rustfmt (due to + # https://github.com/rust-lang/rust/pull/72001) + CFG_RELEASE = rustc.version; + CFG_RELEASE_CHANNEL = if asNightly then "nightly" else "stable"; postInstall = '' wrapProgram $out/bin/cargo-fmt \ diff --git a/pkgs/development/python-modules/mitmproxy-linux/default.nix b/pkgs/development/python-modules/mitmproxy-linux/default.nix index 342ef131b55b..0dd4551a55e4 100644 --- a/pkgs/development/python-modules/mitmproxy-linux/default.nix +++ b/pkgs/development/python-modules/mitmproxy-linux/default.nix @@ -26,10 +26,8 @@ buildPythonPackage { patch -p1 < tmp.diff ''; - env = { - RUSTFLAGS = "-C target-feature="; - RUSTC_BOOTSTRAP = 1; - }; + RUSTFLAGS = "-C target-feature="; + RUSTC_BOOTSTRAP = 1; buildAndTestSubdir = "mitmproxy-linux";