@@ -3,18 +3,22 @@
33# A special kind of derivation that is only meant to be consumed by the
44# nix-shell.
55{
6− inputsFrom ? [], # a list of derivations whose inputs will be made available to the environment
7− buildInputs ? [],
8− nativeBuildInputs ? [],
9− propagatedBuildInputs ? [],
10− propagatedNativeBuildInputs ? [],
11− ...
6+ # a list of packages to add to the shell environment
7+ packages ? [ ]
8+, # propagate all the inputs from the given derivations
9+ inputsFrom ? [ ]
10+, buildInputs ? [ ]
11+, nativeBuildInputs ? [ ]
12+, propagatedBuildInputs ? [ ]
13+, propagatedNativeBuildInputs ? [ ]
14+, ...
1215}@attrs:
1316let
1417 mergeInputs = name: lib.concatLists (lib.catAttrs name
15− ([attrs] ++ inputsFrom));
18+ ([ attrs ] ++ inputsFrom));
1619
1720 rest = builtins.removeAttrs attrs [
21+ "packages"
1822 "inputsFrom"
1923 "buildInputs"
2024 "nativeBuildInputs"
@@ -26,15 +30,15 @@ in
2630
2731stdenv.mkDerivation ({
2832 name = "nix-shell";
29− phases = ["nobuildPhase"];
33+ phases = [ "nobuildPhase" ];
3034
3135 buildInputs = mergeInputs "buildInputs";
32− nativeBuildInputs = mergeInputs "nativeBuildInputs";
36+ nativeBuildInputs = packages ++ (mergeInputs "nativeBuildInputs");
3337 propagatedBuildInputs = mergeInputs "propagatedBuildInputs";
3438 propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs";
3539
3640 shellHook = lib.concatStringsSep "\n" (lib.catAttrs "shellHook"
37− (lib.reverseList inputsFrom ++ [attrs]));
41+ (lib.reverseList inputsFrom ++ [ attrs ]));
3842
3943 nobuildPhase = ''
4044 echo