aboutsummaryrefslogtreecommitdiff
path: root/src/nix/develop.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-23 16:28:26 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-23 16:33:55 +0100
commitc164d304f3cd6c5e536e33435084c030f018c2ab (patch)
treef748d194dff9eb2c82e4fdb512729bc2c203587d /src/nix/develop.cc
parentc9eee5a84d91e974b09623e01d12586e7026f1ce (diff)
nix develop: Set personality
This makes 'nix develop' set the Linux personality in the same way that the actual build does, allowing a command like 'nix develop nix#devShells.i686-linux.default' on x86_64-linux to work correctly.
Diffstat (limited to 'src/nix/develop.cc')
-rw-r--r--src/nix/develop.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index 6c3a9c6c6..1d90d1dac 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -164,6 +164,14 @@ struct BuildEnvironment
{
return vars == other.vars && bashFunctions == other.bashFunctions;
}
+
+ std::string getSystem() const
+ {
+ if (auto v = get(vars, "system"))
+ return getString(*v);
+ else
+ return settings.thisSystem;
+ }
};
const static std::string getEnvSh =
@@ -570,7 +578,7 @@ struct CmdDevelop : Common, MixEnvironment
}
}
- runProgramInStore(store, shell, args);
+ runProgramInStore(store, shell, args, buildEnvironment.getSystem());
}
};