2024-04-03 22:43:39 +02:00
|
|
|
{
|
|
|
|
description = "A basic Rust devshell";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
|
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, rust-overlay, flake-utils, ... }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
overlay-unstable = final: prev: {
|
|
|
|
unstable = import nixpkgs-unstable {
|
|
|
|
localSystem = { inherit system; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
overlays = [ (import rust-overlay) overlay-unstable ];
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system overlays;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with pkgs;
|
|
|
|
{
|
|
|
|
devShells.default = mkShell {
|
|
|
|
buildInputs = [
|
2024-04-19 20:09:42 +02:00
|
|
|
openssh
|
2024-04-03 22:44:11 +02:00
|
|
|
pkg-config
|
|
|
|
cargo-insta
|
|
|
|
llvmPackages_latest.llvm
|
|
|
|
llvmPackages_latest.bintools
|
2024-04-19 20:09:42 +02:00
|
|
|
# llvmPackages_17.clangNoLibc
|
2024-04-03 22:44:11 +02:00
|
|
|
zlib.out
|
2024-04-03 22:43:39 +02:00
|
|
|
dart-sass
|
2024-04-19 20:09:42 +02:00
|
|
|
llvmPackages_17.lld
|
2024-06-18 12:33:21 +02:00
|
|
|
(rust-bin.selectLatestNightlyWith ( toolchain: toolchain.default.override {
|
2024-04-03 22:43:39 +02:00
|
|
|
extensions= [ "rust-src" "rust-analyzer" ];
|
|
|
|
targets = [ "wasm32-unknown-unknown" ];
|
2024-06-18 12:33:21 +02:00
|
|
|
}))
|
2024-04-03 22:43:39 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
alias grep=ripgrep
|
|
|
|
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
2024-04-19 20:09:42 +02:00
|
|
|
# export CC=clang
|
|
|
|
# export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER=lld
|
2024-04-03 22:43:39 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|