diff options
author | Qyriad <qyriad@qyriad.me> | 2024-04-27 13:24:39 -0600 |
---|---|---|
committer | Qyriad <qyriad@qyriad.me> | 2024-04-29 01:19:21 +0000 |
commit | 2bd57d4d36f66de00fa4f791569056e58598e782 (patch) | |
tree | cf8e49b9f2a3c03068c13baa0ef7c43cfae344f6 /src/nix-env/user-env.cc | |
parent | da677fce395fa86dbd5e8b5e3c0bef1712f9c3f1 (diff) |
refactor some nix-env and profile code to libcmd
Notably, ProfileManifest and ProfileElement are useful generic
profile management code, and nix profile is not the only place in the
codebase where profiles are relevant.
This commit is in preparation for fixing upgrade-nix's interaction with
new-style profiles.
Change-Id: Iefc8bbd34b4bc6012175cb3d6e6a8207973bc792
Diffstat (limited to 'src/nix-env/user-env.cc')
-rw-r--r-- | src/nix-env/user-env.cc | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index 757938914..f0131a458 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -16,22 +16,6 @@ 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); - auto manifestFile = userEnv + "/manifest.nix"; - if (pathExists(manifestFile)) { - Value v; - state.evalFile(state.rootPath(CanonPath(manifestFile)), v); - Bindings & bindings(*state.allocBindings(0)); - getDerivations(state, v, "", bindings, elems, false); - } - return elems; -} - - bool createUserEnv(EvalState & state, DrvInfos & elems, const Path & profile, bool keepDerivations, const std::string & lockToken) |