mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
nix-env: Refuse to operate on a new-style profile
This prevents users from accidentally nuking their profile via
nix-env.
(cherry picked from commit 021634e3e3
)
This commit is contained in:
parent
47c568ee32
commit
63fa92605b
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,8 @@ namespace nix {
|
||||||
DrvInfos queryInstalled(EvalState & state, const Path & userEnv)
|
DrvInfos queryInstalled(EvalState & state, const Path & userEnv)
|
||||||
{
|
{
|
||||||
DrvInfos elems;
|
DrvInfos elems;
|
||||||
|
if (pathExists(userEnv + "/manifest.json"))
|
||||||
|
throw Error("profile '%s' is incompatible with 'nix-env'; please use 'nix profile' instead", userEnv);
|
||||||
Path manifestFile = userEnv + "/manifest.nix";
|
Path manifestFile = userEnv + "/manifest.nix";
|
||||||
if (pathExists(manifestFile)) {
|
if (pathExists(manifestFile)) {
|
||||||
Value v;
|
Value v;
|
||||||
|
|
Loading…
Reference in a new issue