Hello, I’m trying to do something similar to what was already asked in another post: Getting access to the RISCV GNU Toolchain (riscv64-unknown-elf). The solution would be fine if the only thing I wanted in my environment was the tool, but there are other packages I want to run on my local system.
Right now, I have a shell.nix
that looks something like this:
{ pkgs ? import <nixpkgs> {} }:
let
python-with-my-packages = pkgs.python3.withPackages (p: with p; [
pyyaml
]);
in
pkgs.mkShell {
buildInputs = [
python-with-my-packages
pkgs.gtkwave
pkgs.verilog
];
}
I was hoping there would be a way to drop in something like pkgs.pkgsCross.riscv32-embedded
into the buildInputs
, but of course that doesn’t work. Other methods I’ve tried involve setting up the cross-compilation system with crossSystem but that just makes the system try to build all those other packages for a RISC-V target.
I understand there’s the “Nixonic” way of doing it… which would be writing a proper derivation for whatever I’m trying to cross-compile, but I need to be able to build this with Make on any other system if needed. All I need is for the riscv32-none-elf tools to be available along with the above packages.
By the way, I have also tried creating the derivation for riscv-gnu-tools based on picorv32/shell.nix, but I get the same error as the user from the post mentioned above.
Thanks.