Fix shell.nix

```
[nix-shell:~/joyofhardware/RiscV-Formal]$ riscv64-unknown-linux-gnu-gcc
bash: /nix/store/xq4q2vv9ii7z2k2qp82jd180xdb0r4fv-gcc-riscv64-unknown-linux-gnu-14-20241116/bin/riscv64-unknown-linux-gnu-gcc: cannot execute binary file: Exec format error
```

`pkgs.pkgsCross.riscv64` is for running on riscv64
`pkgs.pkgsCross.riscv64.buildPackages` is for running on the build
system and compiling code for riscv64

`nativeBuildInputs` is for packages which run on the build system and
compile code for riscv64

with `__splicedPackages` we can avoid having to specify `buildPackages`
and have the dependency attributes (`nativeBuildInputs`) pick the
`buildHost` version of the package
This commit is contained in:
Artturin 2025-02-21 17:04:56 +02:00
parent 003a1c8545
commit eed328e68a

View file

@ -1,10 +1,10 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
let let
riscv64-linux = pkgs.pkgsCross.riscv64; riscv64-linux = pkgs.pkgsCross.riscv64.__splicedPackages;
in in
pkgs.mkShell { pkgs.mkShell {
buildInputs = [ nativeBuildInputs = [
riscv64-linux.gcc riscv64-linux.gcc
riscv64-linux.binutils riscv64-linux.binutils
riscv64-linux.glibc riscv64-linux.glibc