Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
expr.hh
Go to the documentation of this file.
1/* ========================================================================== *
2 *
3 * @file flox/core/expr.hh
4 *
5 * @brief Extensions to `libnix-expr`, the `nix` expression language.
6 *
7 * Adds new `nix` primitive operations, and provides several helper functions.
8 *
9 *
10 * -------------------------------------------------------------------------- */
11
12#pragma once
13
14#include <nix/eval.hh>
15#include <nix/flake/flakeref.hh>
16
17
18/* -------------------------------------------------------------------------- */
19
20namespace flox {
21
22/* -------------------------------------------------------------------------- */
23
32void
33forceTrivialValue( nix::EvalState & state,
34 nix::Value & value,
35 const nix::PosIdx pos = nix::noPos );
36
37
38/* -------------------------------------------------------------------------- */
39
44[[nodiscard]] nix::FlakeRef
45valueToFlakeRef( nix::EvalState & state,
46 nix::Value & value,
47 const nix::PosIdx pos = nix::noPos,
48 const std::string & errorMsg
49 = "while parsing flake reference" );
50
51
52/* -------------------------------------------------------------------------- */
53
54} // namespace flox
55
56
57/* -------------------------------------------------------------------------- *
58 *
59 *
60 *
61 * ========================================================================== */
Interfaces for use by flox.
Definition: command.cc:29
void forceTrivialValue(nix::EvalState &state, nix::Value &value, const nix::PosIdx pos)
Evaluate trivial thunks to values. This has no effect on non-thunks and non-trivial values.
Definition: expr.cc:25
nix::FlakeRef valueToFlakeRef(nix::EvalState &state, nix::Value &value, const nix::PosIdx pos, const std::string &errorMsg)
Convert a nix::Value attribute set or string into a nix::FlakeRef.
Definition: expr.cc:39