From 4a6ebd02231414541941ede9ed06666c12381e91 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Thu, 2 Nov 2023 19:46:49 -0500 Subject: [PATCH] nix: fix the `rustfmt` version by using nightly Summary: Apparently this was broken. Maybe I broke it. Maybe something upstream changed and caused a regression. But without it, we get the stable `rustfmt` in the `nix develop` shell environment, not the nightly version. Fix it. Signed-off-by: Austin Seipp Change-Id: I602ed8e5691c4d48f8db575d62624955 --- flake.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 53260e4e9..1f472b266 100644 --- a/flake.nix +++ b/flake.nix @@ -99,6 +99,12 @@ formatter = pkgs.nixpkgs-fmt; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ + # The CI checks against the latest nightly rustfmt, so we should too. + # NOTE (aseipp): include this FIRST before the rust-version override + # below; otherwise, it will be overridden by the rust-version and + # we'll get stable rustfmt instead. + (rust-bin.selectLatestNightlyWith (toolchain: toolchain.rustfmt)) + # Using the minimal profile with explicit "clippy" extension to avoid # two versions of rustfmt (rust-version.override { @@ -108,9 +114,6 @@ ]; }) - # The CI checks against the latest nightly rustfmt, so we should too. - (rust-bin.selectLatestNightlyWith (toolchain: toolchain.rustfmt)) - # Foreign dependencies openssl zstd libgit2 libssh2 pkg-config