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