diff options
Diffstat (limited to 'pkgs/build-support/mkshell/default.nix')
-rw-r--r-- | pkgs/build-support/mkshell/default.nix | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/pkgs/build-support/mkshell/default.nix b/pkgs/build-support/mkshell/default.nix index a70dc0390cb..7ca4cc23c1d 100644 --- a/pkgs/build-support/mkshell/default.nix +++ b/pkgs/build-support/mkshell/default.nix @@ -3,18 +3,22 @@ # A special kind of derivation that is only meant to be consumed by the # nix-shell. { - inputsFrom ? [], # a list of derivations whose inputs will be made available to the environment - buildInputs ? [], - nativeBuildInputs ? [], - propagatedBuildInputs ? [], - propagatedNativeBuildInputs ? [], - ... + # a list of packages to add to the shell environment + packages ? [ ] +, # propagate all the inputs from the given derivations + inputsFrom ? [ ] +, buildInputs ? [ ] +, nativeBuildInputs ? [ ] +, propagatedBuildInputs ? [ ] +, propagatedNativeBuildInputs ? [ ] +, ... }@attrs: let mergeInputs = name: lib.concatLists (lib.catAttrs name - ([attrs] ++ inputsFrom)); + ([ attrs ] ++ inputsFrom)); rest = builtins.removeAttrs attrs [ + "packages" "inputsFrom" "buildInputs" "nativeBuildInputs" @@ -26,15 +30,15 @@ in stdenv.mkDerivation ({ name = "nix-shell"; - phases = ["nobuildPhase"]; + phases = [ "nobuildPhase" ]; buildInputs = mergeInputs "buildInputs"; - nativeBuildInputs = mergeInputs "nativeBuildInputs"; + nativeBuildInputs = packages ++ (mergeInputs "nativeBuildInputs"); propagatedBuildInputs = mergeInputs "propagatedBuildInputs"; propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs"; shellHook = lib.concatStringsSep "\n" (lib.catAttrs "shellHook" - (lib.reverseList inputsFrom ++ [attrs])); + (lib.reverseList inputsFrom ++ [ attrs ])); nobuildPhase = '' echo |