Update rust workspace template
This commit is contained in:
parent
136e245759
commit
2a2e51f2b6
@ -3,34 +3,40 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, rust-overlay, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ (import rust-overlay) ];
|
||||
inherit system overlays;
|
||||
};
|
||||
|
||||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
rustNightlyToolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal.override {
|
||||
rust = pkgs.rust-bin;
|
||||
|
||||
rustToolchain = rust.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
rustNightlyToolchain = rust.selectLatestNightlyWith (tc: tc.minimal.override {
|
||||
extensions = [ "rustfmt" ];
|
||||
targets = [ "x86_64-unknown-linux-gnu" ];
|
||||
});
|
||||
|
||||
|
||||
buildTools = with pkgs; [
|
||||
buildTools = [
|
||||
rustToolchain
|
||||
rustNightlyToolchain
|
||||
pkg-config
|
||||
];
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
name = "@project_name@";
|
||||
buildInputs = buildTools;
|
||||
packages = with pkgs; [
|
||||
rust-analyzer
|
||||
];
|
||||
};
|
||||
in {
|
||||
devShells.${system}.default = devShell;
|
||||
|
Loading…
Reference in New Issue
Block a user