1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

Merge pull request #5020 from NixOS/make-the-repl-reuse-the-whole-nix-config

Forward the whole Nix config to the repl subprocesses
This commit is contained in:
Eelco Dolstra 2021-07-19 16:02:02 +02:00 committed by GitHub
commit 58cb411db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View file

@ -107,11 +107,8 @@ NixRepl::~NixRepl()
string runNix(Path program, const Strings & args,
const std::optional<std::string> & input = {})
{
auto experimentalFeatures = concatStringsSep(" ", settings.experimentalFeatures.get());
auto nixConf = getEnv("NIX_CONFIG").value_or("");
nixConf.append("\nexperimental-features = " + experimentalFeatures);
auto subprocessEnv = getEnv();
subprocessEnv["NIX_CONFIG"] = nixConf;
subprocessEnv["NIX_CONFIG"] = globalConfig.toKeyValue();
RunOptions opts(settings.nixBinDir+ "/" + program, args);
opts.input = input;
opts.environment = subprocessEnv;