summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/shell.md4
-rw-r--r--pkgs/build-support/mkshell/default.nix (renamed from pkgs/build-support/shell-builder.nix)17
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 12 insertions, 11 deletions
diff --git a/doc/shell.md b/doc/shell.md
index ca90acac92db..a4f999695cbc 100644
--- a/doc/shell.md
+++ b/doc/shell.md
@@ -13,8 +13,8 @@ with nix-build.
```nix
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
- # this will merge all the inputs from hello and gnutar into the shell environment
- mergeInputs = with pkgs; [ hello gnutar ];
+ # this will make all the build inputs from hello and gnutar available to the shell environment
+ inputsFrom = with pkgs; [ hello gnutar ];
buildInputs = [ pkgs.gnumake ];
}
```
diff --git a/pkgs/build-support/shell-builder.nix b/pkgs/build-support/mkshell/default.nix
index afa15bde02f8..a98b4affacba 100644
--- a/pkgs/build-support/shell-builder.nix
+++ b/pkgs/build-support/mkshell/default.nix
@@ -3,23 +3,24 @@
# A special kind of derivation that is only meant to be consumed by the
# nix-shell.
{
- mergeInputs ? [], # a list of derivations whose inputs will be merged
+ inputsFrom ? [], # a list of derivations whose inputs will be made available to the environment
buildInputs ? [],
nativeBuildInputs ? [],
propagatedBuildInputs ? [],
+ propagatedNativeBuildInputs ? [],
...
}@attrs:
let
- mergeInputs' = name:
+ mergeInputs = name:
let
op = item: sum: sum ++ item."${name}" or [];
nul = [];
- list = [attrs] ++ mergeInputs;
+ list = [attrs] ++ inputsFrom;
in
lib.foldr op nul list;
rest = builtins.removeAttrs attrs [
- "mergeInputs"
+ "inputsFrom"
"buildInputs"
"nativeBuildInputs"
"propagatedBuildInputs"
@@ -31,10 +32,10 @@ stdenv.mkDerivation ({
name = "nix-shell";
phases = ["nobuildPhase"];
- buildInputs = mergeInputs' "buildInputs";
- nativeBuildInputs = mergeInputs' "nativeBuildInputs";
- propagatedBuildInputs = mergeInputs' "propagatedBuildInputs";
- propagatedNativeBuildInputs = mergeInputs' "propagatedNativeBuildInputs";
+ buildInputs = mergeInputs "buildInputs";
+ nativeBuildInputs = mergeInputs "nativeBuildInputs";
+ propagatedBuildInputs = mergeInputs "propagatedBuildInputs";
+ propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs";
nobuildPhase = ''
echo
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ec227c940dc2..bdc4276b0eee 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -301,7 +301,7 @@ with pkgs;
inherit kernel rootModules allowMissing;
};
- mkShell = callPackage ../build-supports/shell-builder.nix { };
+ mkShell = callPackage ../build-supports/mkshell { };
nixBufferBuilders = import ../build-support/emacs/buffer.nix { inherit (pkgs) lib writeText; inherit (emacsPackagesNg) inherit-local; };