Skip to content

Commit

Permalink
flake: devShell: add rust nightly for tools
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Aug 27, 2024
1 parent 2cd6e97 commit a9d611d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,24 @@
rustToolchain = lib.importTOML ./rust-toolchain.toml;
rustVersion = rustToolchain.toolchain.channel;
in {
devShells = lib.mapAttrs (system: pkgs: {
default = pkgs.mkShell {
strictDeps = true;
buildInputs = [ pkgs.rust-bin.stable.${rustVersion}.default ];
};
}) pkgsFor;
devShells = lib.mapAttrs (system: pkgs:
let
rust-stable = pkgs.rust-bin.stable.${rustVersion}.minimal.override {
extensions = [ "rust-src" "rust-docs" "clippy" ];
};
in {
default = pkgs.mkShell {
strictDeps = true;
packages = [
(lib.hiPrio rust-stable)
# Use rustfmt, and other tools that require nightly features.
(pkgs.rust-bin.selectLatestNightlyWith (toolchain:
toolchain.minimal.override {
extensions = [ "rustfmt" "rust-analyzer" ];
}))
];
};
}) pkgsFor;

overlays = {
default = lib.composeManyExtensions [ self.overlays.${packageName} ];
Expand Down

0 comments on commit a9d611d

Please sign in to comment.