aboutsummaryrefslogtreecommitdiff
path: root/devShells/nuttx.nix
blob: 40172f08e80f6f9c9c5cf5307023499a6257db46 (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
28
29
30
{ system, nixpkgs, default }:
{ arch, fpu ? null }:
with nixpkgs.lib;
let
  pkgs = nixpkgs.legacyPackages.${system};
  pkgs-cross = 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; [
    kconfig-frontends genromfs xxd
    openocd

    gnumake bear
    meson ninja
    cmake
  ]) ++ (with pkgs-cross.buildPackages; [
    gcc gdb
  ]);
  inputsFrom = [ default ];
  meta.platforms = nixpkgs.lib.platforms.linux;
}