diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-02 11:54:48 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-02 11:54:48 +0200 |
commit | 021634e3e3edb327089d33ab41b743f0a40126da (patch) | |
tree | 8f90f07c605ae5847bc8fcd709b777c27e006da7 /src | |
parent | ed13457dbf1a78f47f760e349985b23dfd5f16c4 (diff) |
nix-env: Refuse to operate on a new-style profile
This prevents users from accidentally nuking their profile via
nix-env.
Diffstat (limited to 'src')
-rw-r--r-- | src/nix-env/user-env.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index 717431b7a..f852916d8 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -15,6 +15,8 @@ namespace nix { DrvInfos queryInstalled(EvalState & state, const Path & userEnv) { 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"; if (pathExists(manifestFile)) { Value v; |