You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
1.1 KiB

let
basePkgs = import ./nix/nixpkgs.nix { };
rust_overlay = with basePkgs; import (fetchFromGitHub
(lib.importJSON ./nix/oxalica_rust_overlay.json));
pkgs = import ./nix/nixpkgs.nix { overlays = [ rust_overlay ]; };
nightlyToolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal.override {
extensions = [ "rustfmt" ];
});
stableToolchain = pkgs.rust-bin.stable."1.56.1".minimal.override {
extensions = [ "clippy" "llvm-tools-preview" "rust-src" ];
};
pre-commit-check = pkgs.callPackage ./nix/pre-commit.nix { };
in
with pkgs;
mkShell {
buildInputs = [
argbash
openssl
pkgconfig
git
stableToolchain
nightlyToolchain
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
shellHook = ''
export RUST_BACKTRACE=full
export PATH="$PATH:$(pwd)/target/debug:$(pwd)/target/release"
# Ensure `cargo fmt` uses `rustfmt` from nightly.
export RUSTFMT="${nightlyToolchain}/bin/rustfmt"
# install pre-commit hooks
${pre-commit-check.shellHook}
'';
}