Skip to content

Commit 2dfc163

Browse files
committed
Replace rust-wrapper with RUSTC_FORCE_RUSTC_VERSION
Requires rust-lang/rust#124339 but drastically simplifies evading nightly-detection
1 parent 2dfdb66 commit 2dfc163

File tree

2 files changed

+5
-37
lines changed

2 files changed

+5
-37
lines changed

shells/rust/default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{ pkgs, lib, ... }:
22
let
3-
wrap-rust = pkgs.callPackage ./wrap-rust.nix {};
43
setup-xdg-cargo-home = pkgs.writeShellApplication {
54
name = "setup-xdg-cargo-home";
65
text = lib.readFile ./setup-xdg-cargo-home;
@@ -40,10 +39,12 @@ in {
4039
}
4140
)),
4241
custom ? true,
43-
}: pkgs.mkShell {
42+
}: let
43+
version = lib.lists.head (lib.strings.split "-" rust-toolchain.version);
44+
in pkgs.mkShell {
4445
buildInputs = with pkgs; [
4546
# Rust itself
46-
(if custom then (wrap-rust rust-toolchain) else rust-toolchain)
47+
rust-toolchain
4748

4849
# Dev utilities
4950
bacon
@@ -130,5 +131,6 @@ in {
130131
131132
# Some crates disable nightly feature detection when this is set
132133
export RUSTC_STAGE=1
134+
export RUSTC_FORCE_RUSTC_VERSION=${version}
133135
'' else "");
134136
}

shells/rust/wrap-rust.nix

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)