Skip to content

Commit

Permalink
fix: Use nightly rust tool chain in shell.nix
Browse files Browse the repository at this point in the history
Note that the rust version is still stable in flake.nix which is used to build
the provide the app via flake.

The rustfmt.toml rules are only supported by rust nightly. With the current
stable rust tool chain in flake.nix, `cargo fmt` gives me warnings like
```
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = false`, unstable features are only available in n
```

The format result with those warnings is different from the current code base
for almost all files. I guess the main contributors of the repo use nightly
rust. If so, we should make it consistent in shell.nix to help other
contributors onboard with the same env.
  • Loading branch information
15cm committed Oct 24, 2023
1 parent 47df39e commit 647bda9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pkgs.mkShell {
packages = with pkgs; [
rustToolchain
rust-analyzer

nodePackages.cspell
Expand All @@ -16,13 +15,13 @@ pkgs.mkShell {
ripgrep
fzf
zoxide

(rust-bin.nightly.latest.rust.override { extensions = [ "rust-src" ]; })
];

buildInputs = with pkgs; lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks; [ Foundation ]
);
buildInputs = with pkgs;
lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ Foundation ]);

env = {
RUST_BACKTRACE = "1";
};
env = { RUST_BACKTRACE = "1"; };
}

0 comments on commit 647bda9

Please sign in to comment.