aboutsummaryrefslogtreecommitdiff
path: root/devShells/nuttx.nix
blob: d3303c14faddaa07329b7450dd5bb35afe8e07bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ nixpkgs, shellrc, system }:
{ arch, fpu ? null }:
with nixpkgs.lib;
let
  pkgs = nixpkgs.legacyPackages.${system};
  pkgs-riscv = import nixpkgs.outPath {
    localSystem = system;
    crossSystem = {
      config = "arm-none-eabi" + (optionalString (fpu != null) "hf");
      libc = "newlib";
      gcc = {
        arch = arch;
      } // (optionalAttrs (fpu != null) { fpu = fpu; });
    };
  };

in pkgs.mkShell {
  packages = (with pkgs; [
    gnumake
    kconfig-frontends genromfs xxd
    openocd
  ]) ++ (with pkgs-riscv.buildPackages; [
    gcc gdb
  ]);
  inputsFrom = [ shellrc.packages.${system}.default ];
  meta.platforms = nixpkgs.lib.platforms.linux;
}