Skip to content

Commit

Permalink
Replace rust-wrapper with RUSTC_FORCE_RUSTC_VERSION
Browse files Browse the repository at this point in the history
Requires rust-lang/rust#124339 but drastically simplifies evading nightly-detection
  • Loading branch information
Nemo157 committed May 2, 2024
1 parent 2dfdb66 commit 2dfc163
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
8 changes: 5 additions & 3 deletions shells/rust/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{ pkgs, lib, ... }:
let
wrap-rust = pkgs.callPackage ./wrap-rust.nix {};
setup-xdg-cargo-home = pkgs.writeShellApplication {
name = "setup-xdg-cargo-home";
text = lib.readFile ./setup-xdg-cargo-home;
Expand Down Expand Up @@ -40,10 +39,12 @@ in {
}
)),
custom ? true,
}: pkgs.mkShell {
}: let
version = lib.lists.head (lib.strings.split "-" rust-toolchain.version);
in pkgs.mkShell {
buildInputs = with pkgs; [
# Rust itself
(if custom then (wrap-rust rust-toolchain) else rust-toolchain)
rust-toolchain

# Dev utilities
bacon
Expand Down Expand Up @@ -130,5 +131,6 @@ in {
# Some crates disable nightly feature detection when this is set
export RUSTC_STAGE=1
export RUSTC_FORCE_RUSTC_VERSION=${version}
'' else "");
}
34 changes: 0 additions & 34 deletions shells/rust/wrap-rust.nix

This file was deleted.

0 comments on commit 2dfc163

Please sign in to comment.