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.
This commit is contained in:
Eelco Dolstra
2022-12-23 16:33:55 +01:00
parent c9eee5a84d
commit c164d304f3
8 changed files with 85 additions and 34 deletions
+9 -1
View File
@@ -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());
}
};