wrb-timings/flake.nix

50 lines
1.4 KiB
Nix
Raw Normal View History

2024-01-22 09:29:49 +01:00
{
2024-01-22 10:10:38 +01:00
description = "A basic Rust devshell";
2024-01-22 09:29:49 +01:00
inputs = {
2024-02-03 11:51:32 +01:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
2024-01-22 10:10:38 +01:00
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
2024-01-22 09:29:49 +01:00
};
2024-02-03 11:51:32 +01:00
outputs = { self, nixpkgs, nixpkgs-unstable, rust-overlay, flake-utils, ... }:
2024-01-22 10:10:38 +01:00
flake-utils.lib.eachDefaultSystem (system:
let
2024-02-03 11:51:32 +01:00
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
localSystem = { inherit system; };
};
};
overlays = [ (import rust-overlay) overlay-unstable ];
2024-01-22 10:10:38 +01:00
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
2024-01-22 17:27:00 +01:00
trunk
2024-02-03 11:51:32 +01:00
dart-sass
2024-02-12 10:10:26 +01:00
unstable.rust-analyzer
2024-02-09 15:15:12 +01:00
llvmPackages.clangNoLibc
llvmPackages.lld
dap
2024-01-22 10:10:38 +01:00
(rust-bin.stable.latest.default.override {
extensions= [ "rust-src" "rust-analyzer" ];
targets = [ "wasm32-unknown-unknown" ];
})
2024-01-22 09:29:49 +01:00
];
shellHook = ''
2024-01-22 10:10:38 +01:00
alias grep=ripgrep
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
2024-02-09 15:15:12 +01:00
export CC=clang
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER=lld
2024-01-22 10:10:38 +01:00
'';
2024-01-22 09:29:49 +01:00
};
2024-01-22 10:10:38 +01:00
}
);
2024-01-22 09:29:49 +01:00
}