Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
flox::FloxFlake Class Reference

#include <flox-flake.hh>

Inheritance diagram for flox::FloxFlake:

Public Member Functions

 FloxFlake (const nix::ref< nix::EvalState > &state, const nix::FlakeRef &ref)
 
nix::ref< nix::eval_cache::EvalCache > openEvalCache ()
 
MaybeCursor maybeOpenCursor (const AttrPath &path)
 
Cursor openCursor (const AttrPath &path)
 

Public Attributes

nix::ref< nix::EvalState > state
 
const nix::flake::LockedFlake lockedFlake
 

Private Attributes

std::shared_ptr< nix::eval_cache::EvalCache > _cache
 

Detailed Description

A convenience wrapper that provides various operations on a flake.

Notably this class is responsible for a nix EvalState and an EvalCache database associated with a flake.

It is recommended that only one FloxFlake be created for a unique flake to avoid synchronization slowdowns with its databases.

Member Function Documentation

◆ maybeOpenCursor()

MaybeCursor flox::FloxFlake::maybeOpenCursor ( const AttrPath path)

Try to open a nix evaluator cursor at a given path. If there is no such attribute this routine will return nullptr.

Parameters
pathThe attribute path try opening.
Returns
nullptr iff there is no such path, otherwise a nix::eval_cache::AttrCursor at path.

◆ openCursor()

Cursor flox::FloxFlake::openCursor ( const AttrPath path)

Open a nix evaluator cursor at a given path. If there is no such attribute this routine will throw an error.

Parameters
pathThe attribute path to open.
Returns
A nix::eval_cache::AttrCursor at path.

◆ openEvalCache()

nix::ref< nix::eval_cache::EvalCache > flox::FloxFlake::openEvalCache ( )

Open a nix evaluator ( with an eval cache when possible ) with the evaluated flake and its outputs in global scope.

Returns
A nix evaluator, potentially with caching.

Member Data Documentation

◆ _cache

std::shared_ptr<nix::eval_cache::EvalCache> flox::FloxFlake::_cache
private

A handle for a cached nix evaluator associated with this flake. This is opened lazily by openEvalCache and remains open until this object is destroyed.


The documentation for this class was generated from the following files: