diff --git a/flake.nix b/flake.nix index 029f674..998d52b 100644 --- a/flake.nix +++ b/flake.nix @@ -42,12 +42,18 @@ }: flake-utils.lib.eachDefaultSystem ( system: let - pkgs = nixpkgs.legacyPackages.${system}; + overlays = [(import rust-overlay)]; + + pkgs = (import nixpkgs) { + inherit system overlays; + }; + inherit system; inherit (pkgs) lib; - overlays = [ (import rust-overlay) ]; - craneLib = crane.lib.${system}; + toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + + craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; src = craneLib.cleanCargoSource (craneLib.path ./.); # Common arguments can be set here to avoid repeating them later diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..c94cf2b --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,11 @@ +[toolchain] +channel = "nightly" +components = [ + "rustfmt", + "rustc", + "rust-src", + "rust-analyzer", + "cargo", + "clippy", +] +profile = "minimal"