2021-01-01 19:04:22 +01:00
|
|
|
let
|
2022-02-16 21:56:57 +01:00
|
|
|
pkgs = import <nixos-unstable> { };
|
|
|
|
fenix = import (fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz") { };
|
2021-01-01 19:04:22 +01:00
|
|
|
in
|
2022-02-16 21:56:57 +01:00
|
|
|
with pkgs;
|
|
|
|
{ windows-cross ? false }:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "rust_shell";
|
|
|
|
|
|
|
|
nativeBuildInputs = []
|
|
|
|
++ lib.optionals windows-cross [
|
|
|
|
pkgsCross.mingwW64.stdenv.cc
|
2021-01-01 19:04:22 +01:00
|
|
|
];
|
2022-02-16 21:56:57 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
(fenix.combine ([
|
|
|
|
fenix.complete.toolchain
|
|
|
|
] ++ lib.optionals windows-cross [
|
|
|
|
fenix.targets.x86_64-pc-windows-gnu.latest.rust-std
|
|
|
|
]))
|
|
|
|
|
|
|
|
(vscode-with-extensions.override {
|
|
|
|
vscodeExtensions = with vscode-extensions; [
|
|
|
|
bbenoist.nix
|
|
|
|
vadimcn.vscode-lldb
|
|
|
|
fenix.rust-analyzer-vscode-extension
|
|
|
|
];
|
|
|
|
})
|
|
|
|
|
|
|
|
# cargo-flamegraph
|
|
|
|
|
|
|
|
# cmake
|
|
|
|
# gcc
|
|
|
|
# llvm_11
|
|
|
|
] ++ lib.optionals windows-cross [
|
|
|
|
pkgsCross.mingwW64.windows.mingw_w64_pthreads
|
|
|
|
];
|
|
|
|
}
|