aboutsummaryrefslogtreecommitdiff
path: root/devShells
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-06-13 08:18:32 +0200
committerKarel Kočí <cynerd@email.cz>2022-06-13 08:18:32 +0200
commit4fa33b32e2567276f84a8ef49cb01328db801fe2 (patch)
treefc000dbb83383660d4090c5f2a1b1659bd168206 /devShells
parentef2e9a31c61afdbb106eea365b1758a1c1ceadca (diff)
downloadnixos-personal-4fa33b32e2567276f84a8ef49cb01328db801fe2.tar.gz
nixos-personal-4fa33b32e2567276f84a8ef49cb01328db801fe2.tar.bz2
nixos-personal-4fa33b32e2567276f84a8ef49cb01328db801fe2.zip
devShells/c: add
Diffstat (limited to 'devShells')
-rw-r--r--devShells/c.nix18
-rw-r--r--devShells/default.nix17
-rw-r--r--devShells/nuttx.nix23
-rw-r--r--devShells/riscv.nix23
4 files changed, 81 insertions, 0 deletions
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;
+}