diff options
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/develop.cc | 5 | ||||
-rw-r--r-- | src/nix/get-env.sh | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/nix/develop.cc b/src/nix/develop.cc index e51de2de8..3443fab73 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -256,6 +256,11 @@ struct Common : InstallableCommand, MixProfile // FIXME: properly unquote 'outputs'. StringMap rewrites; for (auto & outputName : tokenizeString<std::vector<std::string>>(replaceStrings(outputs->second.quoted, "'", ""))) { + std::regex ptrn(R"re(\[([A-z0-9]+)\]=.*)re"); + std::smatch match; + if (std::regex_match(outputName, match, ptrn)) { + outputName = match[1]; + } auto from = buildEnvironment.env.find(outputName); assert(from != buildEnvironment.env.end()); // FIXME: unquote diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh index 091c0f573..b6b8310a9 100644 --- a/src/nix/get-env.sh +++ b/src/nix/get-env.sh @@ -8,7 +8,13 @@ if [[ -n $stdenv ]]; then source $stdenv/setup fi -for __output in $outputs; do +if [ -e .attrs.sh ]; then + __olist="${!outputs[@]}" +else + __olist=$outputs +fi + +for __output in $__olist; do if [[ -z $__done ]]; then export > ${!__output} set >> ${!__output} |