packagekit/backends/nix/nix-lib-plus.hh
Bobby Rong 30bb82da8d
Nix: fix build with Nix 2.8.0 (#538)
* nix/nix-lib-plus: synchronize Nix 2.7 changes

49b0bb0206

forceValue: make pos mandatory

- Make passing the position to `forceValue` mandatory,
  this way we remember people that the position is
  important for better error messages
- Add pos to all `forceValue` calls

----------------------------------------------------------------------------

bd383d1b6f

Make most calls to determinePos() lazy

----------------------------------------------------------------------------

df552ff53e

Remove std::string alias (for real this time)

Also use std::string_view in a few more places.

----------------------------------------------------------------------------

b55d79728c

Add EvalState::coerceToStorePath() helper

This is useful whenever we want to evaluate something to a store path
(e.g. in get-drvs.cc).

Extracted from the lazy-trees branch (where we can require that a
store path must come from a store source tree accessor).

* nix/pk-backend-nix: correct the return type of nix_get_cursor

98e361ad4c

nix::eval_cache::AttrCursor::findAlongAttrPath is returning
nix::OrSuggestions<nix::ref<nix::eval_cache::AttrCursor>> instead of
std::shared_ptr<nix::eval_cache::AttrCursor>

* nix/pk-backend-nix: rename nix_get_cursor to nix_get_attr_or_suggestions

Since the return type is changed, we do this to match reality.

* nix: require version 2.7

With the introduction of nix::OrSuggestions, this should
no longer build with Nix older than 2.7.

* nix/nix-lib-plus: synchronize Nix 2.8 changes

5736661922

 nix-env: always print output names in JSON and XML

The current `--out-path` flag has two disadvantages when one is only
concerned with querying the names of outputs:
- it requires evaluating every output's `outPath`, which takes
  significantly more resources and runs into more failures
- it destroys the information of the order of outputs so we can't tell
  which one is the main output

This patch makes the output names always present (replacing paths with
`null` in JSON if `--out-path` isn't given), and adds an `outputName`
field.

----------------------------------------------------------------------------

a0259a21a4

Don't hide repeated values while generating manifest.nix

* nix: require version 2.8
2022-04-22 15:37:04 -05:00

25 lines
790 B
C++

/*
Taken from Nix source files, requires Nix libraries to build.
Nix is a powerful package manager for Linux and other Unix systems that
makes package management reliable and reproducible. It provides atomic
upgrades and rollbacks, side-by-side installation of multiple versions of a
package, multi-user package management and easy setup of build environments.
Nix is licensed under the LGPL v2.1
Additional source code is available at https://github.com/NixOS/nix
For more information visit http://nixos.org/nix/
*/
#pragma once
#include <nix/get-drvs.hh>
namespace nix {
bool createUserEnv(EvalState & state, DrvInfos & elems, const Path & profile, bool keepDerivations, const std::string & lockToken);
DrvInfos queryInstalled(EvalState & state, const Path & userEnv);
}