53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
{
|
|
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 = [
|
|
openssh
|
|
pkg-config
|
|
cargo-insta
|
|
llvmPackages_latest.llvm
|
|
llvmPackages_latest.bintools
|
|
# llvmPackages_17.clangNoLibc
|
|
zlib.out
|
|
dart-sass
|
|
llvmPackages_17.lld
|
|
(rust-bin.stable.latest.default.override {
|
|
extensions= [ "rust-src" "rust-analyzer" ];
|
|
targets = [ "wasm32-unknown-unknown" ];
|
|
})
|
|
];
|
|
|
|
shellHook = ''
|
|
alias grep=ripgrep
|
|
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
|
|
# export CC=clang
|
|
# export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER=lld
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|