wrb-timings/flake.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

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-03 22:44:11 +02:00
openssl
pkg-config
cargo-insta
llvmPackages_latest.llvm
llvmPackages_latest.bintools
llvmPackages_latest.clangNoLibc
2024-04-03 22:44:11 +02:00
zlib.out
2024-04-03 22:43:39 +02:00
dart-sass
2024-04-03 22:44:11 +02:00
llvmPackages_latest.lld
2024-04-03 22:43:39 +02:00
(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
'';
};
}
);
}