From 4fa33b32e2567276f84a8ef49cb01328db801fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 13 Jun 2022 08:18:32 +0200 Subject: devShells/c: add --- devShells/c.nix | 18 ++++++++++++++++++ devShells/default.nix | 17 +++++++++++++++++ devShells/nuttx.nix | 23 +++++++++++++++++++++++ devShells/riscv.nix | 23 +++++++++++++++++++++++ develop/default.nix | 16 ---------------- develop/nuttx.nix | 23 ----------------------- develop/riscv.nix | 23 ----------------------- flake.lock | 11 +++++------ flake.nix | 5 ++--- 9 files changed, 88 insertions(+), 71 deletions(-) create mode 100644 devShells/c.nix create mode 100644 devShells/default.nix create mode 100644 devShells/nuttx.nix create mode 100644 devShells/riscv.nix delete mode 100644 develop/default.nix delete mode 100644 develop/nuttx.nix delete mode 100644 develop/riscv.nix diff --git a/devShells/c.nix b/devShells/c.nix new file mode 100644 index 0000000..2a16700 --- /dev/null +++ b/devShells/c.nix @@ -0,0 +1,18 @@ +{ nixpkgs, shellrc, system }: +let + pkgs = nixpkgs.legacyPackages.${system}; + +in pkgs.mkShell { + packages = (with pkgs; [ + ccls gcc gdb + cppcheck flawfinder bear + meson + lcov massif-visualizer + ]); + inputsFrom = with pkgs; [ + check + + shellrc.packages.${system}.default + ]; + meta.platforms = nixpkgs.lib.platforms.linux; +} diff --git a/devShells/default.nix b/devShells/default.nix new file mode 100644 index 0000000..108d6a3 --- /dev/null +++ b/devShells/default.nix @@ -0,0 +1,17 @@ +{ nixpkgs, shellrc, system }: +let + + callDevelop = file: import file { + inherit nixpkgs; + inherit shellrc; + inherit system; + }; + +in { + + armv6 = callDevelop ./nuttx.nix "armv6-m"; + armv7e = callDevelop ./nuttx.nix "armv7e-m"; + c = callDevelop ./c.nix; + riscv = callDevelop ./riscv.nix; + +} diff --git a/devShells/nuttx.nix b/devShells/nuttx.nix new file mode 100644 index 0000000..3066997 --- /dev/null +++ b/devShells/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; +} diff --git a/devShells/riscv.nix b/devShells/riscv.nix new file mode 100644 index 0000000..ded7859 --- /dev/null +++ b/devShells/riscv.nix @@ -0,0 +1,23 @@ +{ nixpkgs, shellrc, system }: +let + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-riscv = import nixpkgs.outPath { + localSystem = system; + crossSystem = { + config = "riscv32-none-elf"; + libc = "newlib"; + gcc = { + arch = "rv32i"; + }; + }; + }; + +in pkgs.mkShell { + packages = (with pkgs; [ + qtrvsim + ]) ++ (with pkgs-riscv.buildPackages; [ + gcc pkg-config + ]); + inputsFrom = [ shellrc.packages.${system}.default ]; + meta.platforms = nixpkgs.lib.platforms.linux; +} diff --git a/develop/default.nix b/develop/default.nix deleted file mode 100644 index 421250f..0000000 --- a/develop/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ nixpkgs, shellrc, system }: -let - - 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 deleted file mode 100644 index 3066997..0000000 --- a/develop/nuttx.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ 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; -} diff --git a/develop/riscv.nix b/develop/riscv.nix deleted file mode 100644 index ded7859..0000000 --- a/develop/riscv.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ nixpkgs, shellrc, system }: -let - pkgs = nixpkgs.legacyPackages.${system}; - pkgs-riscv = import nixpkgs.outPath { - localSystem = system; - crossSystem = { - config = "riscv32-none-elf"; - libc = "newlib"; - gcc = { - arch = "rv32i"; - }; - }; - }; - -in pkgs.mkShell { - packages = (with pkgs; [ - qtrvsim - ]) ++ (with pkgs-riscv.buildPackages; [ - gcc pkg-config - ]); - inputsFrom = [ shellrc.packages.${system}.default ]; - meta.platforms = nixpkgs.lib.platforms.linux; -} diff --git a/flake.lock b/flake.lock index 318f8e2..d16db89 100644 --- a/flake.lock +++ b/flake.lock @@ -44,11 +44,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1654964420, - "narHash": "sha256-Pu9TvVyWMLH362RGBYKMgX2ILSxRPtWovBmBC2s6Zjo=", + "lastModified": 1655034456, + "narHash": "sha256-HXXyvGqZLa+2u8IPIRm/uNQiw+gBtTNu58YaXMJtKRc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "419e07c3823fff0bbe24b2759a2d73a01ecd3c69", + "rev": "72b1ec0a79b1fc50f6cc0694c2f0b1eb384a932e", "type": "github" }, "original": { @@ -169,14 +169,13 @@ "locked": { "lastModified": 1654787204, "narHash": "sha256-SFzlL4FxwazJqzMPvLPT0IVWaYqV+NMdHxOEOawZ9Z8=", - "owner": "cynerd", + "owner": "wentasah", "repo": "sterm", "rev": "aec0022e09119ec4e0cf8ba85515cbde907384b6", "type": "github" }, "original": { - "owner": "cynerd", - "ref": "comp", + "owner": "wentasah", "repo": "sterm", "type": "github" } diff --git a/flake.nix b/flake.nix index 3de33af..a887fe3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,8 +6,7 @@ nixturris.url = "git+https://git.cynerd.cz/nixturris"; personal-secret.url = "git+ssh://git@cynerd.cz/nixos-personal-secret"; - #sterm.url = "github:wentasah/sterm"; - sterm.url = "github:cynerd/sterm/comp"; + sterm.url = "github:wentasah/sterm"; }; outputs = { self @@ -76,7 +75,7 @@ import ./pkgs { nixpkgs = nixpkgs.legacyPackages."${system}"; } )); devShells = filterPackages system - (import ./develop { inherit nixpkgs; inherit shellrc; inherit system; }); + (import ./devShells { inherit nixpkgs; inherit shellrc; inherit system; }); }); } -- cgit v1.2.3