aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-10-25 10:24:24 +0200
committerKarel Kočí <cynerd@email.cz>2022-10-25 10:24:24 +0200
commit73c30ecbeee78a78d46567edb8875283977637ac (patch)
tree6d6691891e1c0cde33c1111d1f0e2f98e8b2302d
parenta7325e3972203885c1b13f2beac40561c6922953 (diff)
downloadnixos-personal-73c30ecbeee78a78d46567edb8875283977637ac.tar.gz
nixos-personal-73c30ecbeee78a78d46567edb8875283977637ac.tar.bz2
nixos-personal-73c30ecbeee78a78d46567edb8875283977637ac.zip
devShells: add espc
-rw-r--r--devShells/default.nix1
-rw-r--r--devShells/nuttx.nix9
2 files changed, 8 insertions, 2 deletions
diff --git a/devShells/default.nix b/devShells/default.nix
index 24d8cfb..02ecc11 100644
--- a/devShells/default.nix
+++ b/devShells/default.nix
@@ -13,6 +13,7 @@ let
armv6 = callDevelop ./nuttx.nix { arch = "armv6s-m"; };
armv7e = callDevelop ./nuttx.nix { arch = "armv7e-m"; fpu = "vfpv3-d16"; };
+ espc = callDevelop ./nuttx.nix { arch = "rv32imc"; };
c = callDevelop ./c.nix { };
qt = callDevelop ./qt.nix { };
riscv = callDevelop ./riscv.nix { };
diff --git a/devShells/nuttx.nix b/devShells/nuttx.nix
index 0246ad2..03f51f9 100644
--- a/devShells/nuttx.nix
+++ b/devShells/nuttx.nix
@@ -2,12 +2,15 @@
, default, c
, arch, fpu ? null
}:
+with builtins;
with nixpkgs.lib;
let
pkgs = import nixpkgs.outPath {
localSystem = system;
crossSystem = {
- config = "arm-none-eabi" + (optionalString (fpu != null) "hf");
+ config = if (match "armv.*" arch != null) then
+ "arm-none-eabi" + (optionalString (fpu != null) "hf")
+ else "riscv32-none-elf";
libc = "newlib";
gcc = {
arch = arch;
@@ -20,7 +23,9 @@ in pkgs.buildPackages.mkShell {
kconfig-frontends genromfs xxd
openocd
gcc gdb
- ];
+ ] ++ (optionals (match "rv32.*" arch != null) [
+ esptool
+ ]);
inputsFrom = [ default c ];
meta.platforms = nixpkgs.lib.platforms.linux;
}