aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-08-24 08:47:15 +0200
committerKarel Kočí <cynerd@email.cz>2022-08-24 08:47:15 +0200
commit929d898bf77ee0d8f8d4f504483369411e2009da (patch)
treef57a8f36e32fa6efd7f612dc820a15d20f56ec47
parent7fdca49b75b85a41da9dae34b01a01c88f38c142 (diff)
downloadnixos-personal-929d898bf77ee0d8f8d4f504483369411e2009da.tar.gz
nixos-personal-929d898bf77ee0d8f8d4f504483369411e2009da.tar.bz2
nixos-personal-929d898bf77ee0d8f8d4f504483369411e2009da.zip
devShells: allow easier inheritence
-rw-r--r--devShells/c.nix7
-rw-r--r--devShells/default.nix36
-rw-r--r--devShells/nuttx.nix12
-rw-r--r--devShells/qt.nix7
-rw-r--r--devShells/riscv.nix6
-rw-r--r--flake.lock6
6 files changed, 36 insertions, 38 deletions
diff --git a/devShells/c.nix b/devShells/c.nix
index c8b16fa..cf179d0 100644
--- a/devShells/c.nix
+++ b/devShells/c.nix
@@ -1,4 +1,6 @@
-{ system, nixpkgs, default }:
+{ system, nixpkgs
+, default
+}:
let
pkgs = nixpkgs.legacyPackages.${system};
@@ -8,7 +10,8 @@ in pkgs.mkShell {
clang-tools_14 ctags
gcc gdb pkg-config
- meson ninja bear
+ gnumake bear
+ meson ninja
cmake
valgrind
diff --git a/devShells/default.nix b/devShells/default.nix
index c459aba..24d8cfb 100644
--- a/devShells/default.nix
+++ b/devShells/default.nix
@@ -1,27 +1,21 @@
{ nixpkgs, shellrc, system }:
let
- default = let
- pkgs = nixpkgs.legacyPackages.${system};
- in pkgs.mkShell {
- inputsFrom = with pkgs; [
- shellrc.packages.${system}.default
- ];
- };
-
- callDevelop = file: import file {
- inherit system;
- inherit nixpkgs;
- inherit default;
- };
+ callDevelop = nixpkgs.lib.callPackageWith ({
+ inherit system;
+ inherit nixpkgs;
+ } // shells);
-in {
+ shells = {
+ default = nixpkgs.legacyPackages.${system}.mkShell {
+ inputsFrom = [ shellrc.packages.${system}.default ];
+ };
- default = default;
- armv6 = callDevelop ./nuttx.nix { arch = "armv6s-m"; };
- armv7e = callDevelop ./nuttx.nix { arch = "armv7e-m"; fpu = "vfpv3-d16"; };
- c = callDevelop ./c.nix;
- qt = callDevelop ./qt.nix;
- riscv = callDevelop ./riscv.nix;
+ armv6 = callDevelop ./nuttx.nix { arch = "armv6s-m"; };
+ armv7e = callDevelop ./nuttx.nix { arch = "armv7e-m"; fpu = "vfpv3-d16"; };
+ c = callDevelop ./c.nix { };
+ qt = callDevelop ./qt.nix { };
+ riscv = callDevelop ./riscv.nix { };
+ };
-}
+in shells
diff --git a/devShells/nuttx.nix b/devShells/nuttx.nix
index 40172f0..0105fe5 100644
--- a/devShells/nuttx.nix
+++ b/devShells/nuttx.nix
@@ -1,5 +1,7 @@
-{ system, nixpkgs, default }:
-{ arch, fpu ? null }:
+{ system, nixpkgs
+, default, c
+, arch, fpu ? null
+}:
with nixpkgs.lib;
let
pkgs = nixpkgs.legacyPackages.${system};
@@ -18,13 +20,9 @@ in pkgs.mkShell {
packages = (with pkgs; [
kconfig-frontends genromfs xxd
openocd
-
- gnumake bear
- meson ninja
- cmake
]) ++ (with pkgs-cross.buildPackages; [
gcc gdb
]);
- inputsFrom = [ default ];
+ inputsFrom = [ default c ];
meta.platforms = nixpkgs.lib.platforms.linux;
}
diff --git a/devShells/qt.nix b/devShells/qt.nix
index b770ca1..36d41c8 100644
--- a/devShells/qt.nix
+++ b/devShells/qt.nix
@@ -1,10 +1,11 @@
-{ system, nixpkgs, default }:
+{ system, nixpkgs
+, default, c
+}:
let
pkgs = nixpkgs.legacyPackages.${system};
in pkgs.mkShell {
packages = (with pkgs; with libsForQt5; [
- cmake
qt5.full
doctest
@@ -19,6 +20,6 @@ in pkgs.mkShell {
buildInputs = oldAttrs.buildInputs ++ [qt5.full];
}))
]);
- inputsFrom = with pkgs; [ default ];
+ inputsFrom = with pkgs; [ default c ];
meta.platforms = nixpkgs.lib.platforms.linux;
}
diff --git a/devShells/riscv.nix b/devShells/riscv.nix
index bd19eef..e9e33ef 100644
--- a/devShells/riscv.nix
+++ b/devShells/riscv.nix
@@ -1,4 +1,6 @@
-{ system, nixpkgs, default }:
+{ system, nixpkgs
+, default, c
+}:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs-riscv = import nixpkgs.outPath {
@@ -18,6 +20,6 @@ in pkgs.mkShell {
]) ++ (with pkgs-riscv.buildPackages; [
gcc pkg-config
]);
- inputsFrom = [ default ];
+ inputsFrom = [ default c ];
meta.platforms = nixpkgs.lib.platforms.linux;
}
diff --git a/flake.lock b/flake.lock
index 8da2872..c0fe697 100644
--- a/flake.lock
+++ b/flake.lock
@@ -58,11 +58,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1661120702,
- "narHash": "sha256-o2P8sp6FaCwPT8i67Un3w5DN0+nFnY8e9xk7Tj0hpmE=",
+ "lastModified": 1661239106,
+ "narHash": "sha256-C5OCLnrv2c4CHs9DMEtYKkjJmGL7ySAZ1PqPkHBonxQ=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "3ed15c29ce0fd1c3fcfbbeebcf1607057200d83c",
+ "rev": "963d27a0767422be9b8686a8493dcade6acee992",
"type": "github"
},
"original": {