From 1606d1923208d95cce19e12ee441206b13289ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 12 Jun 2022 12:01:56 +0200 Subject: develop: add nuttx --- develop/default.nix | 15 +++++++++++++-- develop/nuttx.nix | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 develop/nuttx.nix diff --git a/develop/default.nix b/develop/default.nix index 5f880dc..421250f 100644 --- a/develop/default.nix +++ b/develop/default.nix @@ -1,5 +1,16 @@ -{ nixpkgs, shellrc, system }: { +{ nixpkgs, shellrc, system }: +let - riscv = import ./riscv.nix { inherit nixpkgs; inherit shellrc; inherit system; }; + callDevelop = file: import file { + inherit nixpkgs; + inherit shellrc; + inherit system; + }; + +in { + + armv6 = callDevelop ./nuttx.nix "armv6-m"; + armv7e = callDevelop ./nuttx.nix "armv7e-m"; + riscv = callDevelop ./riscv.nix; } diff --git a/develop/nuttx.nix b/develop/nuttx.nix new file mode 100644 index 0000000..3066997 --- /dev/null +++ b/develop/nuttx.nix @@ -0,0 +1,23 @@ +{ nixpkgs, shellrc, system }: arch: +let + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-riscv = import nixpkgs.outPath { + localSystem = system; + crossSystem = { + config = "arm-none-eabi"; + libc = "newlib"; + gcc = { + arch = arch; + }; + }; + }; + +in pkgs.mkShell { + packages = (with pkgs; [ + kconfig-frontends + ]) ++ (with pkgs-riscv.buildPackages; [ + gcc gdb + ]); + inputsFrom = [ shellrc.packages.${system}.default ]; + meta.platforms = nixpkgs.lib.platforms.linux; +} -- cgit v1.2.3