nixd
Loading...
Searching...
No Matches
Deserialize.h
Go to the documentation of this file.
1#pragma once
2
3#include "HookExpr.h"
4#include "PtrPool.h"
5
6#include <nix/input-accessor.hh>
7#include <nix/nixexpr.hh>
8
9#include <string_view>
10
11namespace nixt {
12
13/// \brief API Wrapper around nix::
14///
15/// Paths related to this context is very unstable.
17 nix::SymbolTable &STable;
18 nix::PosTable &PTable;
19
20 /// Path resolution
21 const nix::SourcePath BasePath;
22 const nix::ref<nix::InputAccessor> RootFS;
23
24 const nix::Pos::Origin &Origin;
25};
26
27/// \brief Stable API wrapper around official nix.
28///
29/// Because of "lazy-trees", these APIs have always breaked among nix updates,
30/// the function wraps the context with a "stable" class `nix::EvalState`.
32 std::string_view BasePath,
33 const nix::Pos::Origin &Origin);
34
35nix::Expr *deserializeHookable(std::string_view &Data, DeserializeContext &Ctx,
36 PtrPool<nix::Expr> &Pool, ValueMap &VMap,
37 EnvMap &EMap);
38
39} // namespace nixt
Pointer pool, for RAII memory management.
Access EvalCache in nix::EvalState.
Definition ArrayRef.h:7
std::map< std::uintptr_t, nix::Env * > EnvMap
Definition HookExpr.h:10
DeserializeContext getDeserializeContext(nix::EvalState &State, std::string_view BasePath, const nix::Pos::Origin &Origin)
Stable API wrapper around official nix.
std::map< std::uintptr_t, nix::Value > ValueMap
Definition HookExpr.h:9
nix::Expr * deserializeHookable(std::string_view &Data, DeserializeContext &Ctx, PtrPool< nix::Expr > &Pool, ValueMap &VMap, EnvMap &EMap)
API Wrapper around nix::
Definition Deserialize.h:16
const nix::Pos::Origin & Origin
Definition Deserialize.h:24
const nix::ref< nix::InputAccessor > RootFS
Definition Deserialize.h:22
const nix::SourcePath BasePath
Path resolution.
Definition Deserialize.h:21
nix::SymbolTable & STable
Definition Deserialize.h:17
nix::PosTable & PTable
Definition Deserialize.h:18
A simple pointer pool, a vector of unique_ptrs.
Definition PtrPool.h:22