mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
nix develop: Support derivations with multiple outputs
This commit is contained in:
parent
cd8eb8a7d1
commit
68f524d717
3 changed files with 12 additions and 0 deletions
|
@ -130,7 +130,9 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
|
|||
drvName += "-env";
|
||||
for (auto & output : drv.outputs)
|
||||
drv.env.erase(output.first);
|
||||
drv.outputs = {{"out", DerivationOutput { .path = StorePath::dummy }}};
|
||||
drv.env["out"] = "";
|
||||
drv.env["_outputs_saved"] = drv.env["outputs"];
|
||||
drv.env["outputs"] = "out";
|
||||
drv.inputSrcs.insert(std::move(getEnvShPath));
|
||||
Hash h = hashDerivationModulo(*store, drv, true);
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
set -e
|
||||
if [ -e .attrs.sh ]; then source .attrs.sh; fi
|
||||
|
||||
outputs=$_outputs_saved
|
||||
for __output in $_outputs_saved; do
|
||||
declare "$__output"="$out"
|
||||
done
|
||||
unset _outputs_saved __output
|
||||
|
||||
export IN_NIX_SHELL=impure
|
||||
export dontAddDisableDepTrack=1
|
||||
|
||||
if [[ -n $stdenv ]]; then
|
||||
source $stdenv/setup
|
||||
fi
|
||||
|
||||
export > $out
|
||||
set >> $out
|
||||
|
|
|
@ -24,6 +24,7 @@ let pkgs = rec {
|
|||
VAR_FROM_NIX = "bar";
|
||||
TEST_inNixShell = if inNixShell then "true" else "false";
|
||||
inherit stdenv;
|
||||
outputs = ["dev" "out"];
|
||||
};
|
||||
|
||||
# Used by nix-shell -p
|
||||
|
|
Loading…
Reference in a new issue