uefi-rs/shell.nix
Philipp Schuster b65cac29bf nix: get rust toolchain from rust-overlay
Now, a nix-shell always has the latest rust stable version, compliant to our
rust-toolchain.toml file.
2023-11-24 10:54:43 +01:00

37 lines
970 B
Nix

# Sets up a basic shell environment with all relevant tooling to run
# "cargo xtask run|test|clippy". It uses rustup rather than a pinned rust
# toolchain.
let
sources = import ./nix/sources.nix;
pkgs = import ./nix/nixpkgs.nix;
rustToolchain = pkgs.callPackage ./nix/rust-toolchain.nix {};
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
# nix related stuff (such as dependency management)
niv
nixpkgs-fmt
# Integration test dependencies
swtpm
qemu
# Rust toolchain
rustToolchain
# Other
yamlfmt
which # used by "cargo xtask fmt"
];
# Set ENV vars.
# OVMF_CODE="${pkgs.OVMF.firmware}";
# OVMF_VARS="${pkgs.OVMF.variables}";
# OVMF_SHELL="${pkgs.edk2-uefi-shell}";
# To invoke "nix-shell" in the CI-runner, we need a global Nix channel.
# For better reproducibility inside the Nix shell, we override this channel
# with the pinned nixpkgs version.
NIX_PATH = "nixpkgs=${sources.nixpkgs}";
}