riscv64-emulator/flake.nix

34 lines
819 B
Nix
Raw Normal View History

2023-02-04 09:13:22 +00:00
{
inputs = { fenix.url = "github:nix-community/fenix"; };
outputs = { self, nixpkgs, flake-utils, fenix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ fenix.overlays.default ];
};
toolchain = pkgs.fenix.stable;
targetPkgs = pkgs.pkgsCross.riscv64;
in rec {
legacyPackages = pkgs;
devShell = pkgs.mkShell {
inputsFrom = [ ];
packages = (with pkgs; [
cargo-watch
cargo-deny
cargo-edit
targetPkgs.stdenv.cc
(qemu.override {
hostCpuTargets = [ "${targetPkgs.system}-user" ];
})
]) ++ (with toolchain; [ cargo rustc rustfmt clippy ]);
};
});
}