diff options
author | Karel Kočí <cynerd@email.cz> | 2023-01-08 11:25:01 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2023-01-08 11:25:01 +0100 |
commit | d5dc7479c489d17e6dcacf081c0f1b5242d99bd9 (patch) | |
tree | c12d18231cacb81ff5b69a2073894d228e3c81e7 /devShells/nuttx.nix | |
parent | c7a226a92d65cedd384fa29083efdbb07a6084b0 (diff) | |
download | nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.gz nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.tar.bz2 nixos-personal-d5dc7479c489d17e6dcacf081c0f1b5242d99bd9.zip |
Format using Alejandra
Diffstat (limited to 'devShells/nuttx.nix')
-rw-r--r-- | devShells/nuttx.nix | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/devShells/nuttx.nix b/devShells/nuttx.nix index 2d3e271..14367c6 100644 --- a/devShells/nuttx.nix +++ b/devShells/nuttx.nix @@ -1,31 +1,42 @@ -{ system, nixpkgs -, default, c -, arch, fpu ? null +{ + system, + nixpkgs, + default, + c, + arch, + fpu ? null, }: with builtins; -with nixpkgs.lib; -let +with nixpkgs.lib; let pkgs = import nixpkgs.outPath { localSystem = system; crossSystem = { - config = if (hasPrefix "armv" arch) then - "arm-none-eabi" + (optionalString (fpu != null) "hf") + config = + if (hasPrefix "armv" arch) + then "arm-none-eabi" + (optionalString (fpu != null) "hf") else "riscv32-none-elf"; libc = "newlib-nano"; - gcc = { - arch = arch; - } // (optionalAttrs (fpu != null) { fpu = fpu; }); + gcc = + { + arch = arch; + } + // (optionalAttrs (fpu != null) {fpu = fpu;}); }; }; - -in pkgs.buildPackages.mkShell { - packages = with pkgs.buildPackages; [ - kconfig-frontends genromfs xxd - openocd - gcc gdb - ] ++ (optionals (hasPrefix "rv32" arch) [ - esptool - ]); - inputsFrom = [ default c ]; - meta.platforms = nixpkgs.lib.platforms.linux; -} +in + pkgs.buildPackages.mkShell { + packages = with pkgs.buildPackages; + [ + kconfig-frontends + genromfs + xxd + openocd + gcc + gdb + ] + ++ (optionals (hasPrefix "rv32" arch) [ + esptool + ]); + inputsFrom = [default c]; + meta.platforms = nixpkgs.lib.platforms.linux; + } |