diff --git a/flake.nix b/flake.nix index 32cadb0..4e038aa 100644 --- a/flake.nix +++ b/flake.nix @@ -26,12 +26,25 @@ rustToolchain = lib.importTOML ./rust-toolchain.toml; rustVersion = rustToolchain.toolchain.channel; in { - devShells = lib.mapAttrs (system: pkgs: { - default = pkgs.mkShell { + devShells = lib.mapAttrs (system: pkgs: + let + rust-stable = pkgs.rust-bin.stable.${rustVersion}.minimal.override { + extensions = [ "rust-src" "rust-docs" "clippy" ]; + }; + in { strictDeps = true; - buildInputs = [ pkgs.rust-bin.stable.${rustVersion}.default ]; - }; - }) pkgsFor; + 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} ];