Loading pkgs/build-support/mkshell/default.nix +48 −57 Original line number Diff line number Diff line { lib, stdenv, buildEnv, }: # A special kind of derivation that is only meant to be consumed by the # nix-shell. lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "packages" "inputsFrom" ]; extendDrvArgs = _finalAttrs: { name ? "nix-shell", # 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 Loading @@ -28,20 +32,7 @@ let # 3. filter out of the result everything that's in `inputsFrom` itself # this leaves actual dependencies of the derivations in `inputsFrom`, but never the derivations themselves (lib.subtractLists inputsFrom (lib.flatten (lib.catAttrs name inputsFrom))); rest = removeAttrs attrs [ "name" "packages" "inputsFrom" "buildInputs" "nativeBuildInputs" "propagatedBuildInputs" "propagatedNativeBuildInputs" "shellHook" ]; in stdenv.mkDerivation ( { inherit name; Loading @@ -54,9 +45,10 @@ stdenv.mkDerivation ( lib.catAttrs "shellHook" (lib.reverseList inputsFrom ++ [ attrs ]) ); phases = [ "buildPhase" ]; phases = attrs.phases or [ "buildPhase" ]; buildPhase = '' buildPhase = attrs.buildPhase or '' { echo "------------------------------------------------------------"; echo " WARNING: the existence of this path is not guaranteed."; echo " It is an internal implementation detail for pkgs.mkShell."; Loading @@ -67,7 +59,6 @@ stdenv.mkDerivation ( } >> "$out" ''; preferLocalBuild = true; preferLocalBuild = attrs.preferLocalBuild or true; }; } // rest ) Loading
pkgs/build-support/mkshell/default.nix +48 −57 Original line number Diff line number Diff line { lib, stdenv, buildEnv, }: # A special kind of derivation that is only meant to be consumed by the # nix-shell. lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "packages" "inputsFrom" ]; extendDrvArgs = _finalAttrs: { name ? "nix-shell", # 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 Loading @@ -28,20 +32,7 @@ let # 3. filter out of the result everything that's in `inputsFrom` itself # this leaves actual dependencies of the derivations in `inputsFrom`, but never the derivations themselves (lib.subtractLists inputsFrom (lib.flatten (lib.catAttrs name inputsFrom))); rest = removeAttrs attrs [ "name" "packages" "inputsFrom" "buildInputs" "nativeBuildInputs" "propagatedBuildInputs" "propagatedNativeBuildInputs" "shellHook" ]; in stdenv.mkDerivation ( { inherit name; Loading @@ -54,9 +45,10 @@ stdenv.mkDerivation ( lib.catAttrs "shellHook" (lib.reverseList inputsFrom ++ [ attrs ]) ); phases = [ "buildPhase" ]; phases = attrs.phases or [ "buildPhase" ]; buildPhase = '' buildPhase = attrs.buildPhase or '' { echo "------------------------------------------------------------"; echo " WARNING: the existence of this path is not guaranteed."; echo " It is an internal implementation detail for pkgs.mkShell."; Loading @@ -67,7 +59,6 @@ stdenv.mkDerivation ( } >> "$out" ''; preferLocalBuild = true; preferLocalBuild = attrs.preferLocalBuild or true; }; } // rest )