16#include <nix/repair-flag.hh>
17#include <nix/search-path.hh>
18#include <nix/store-api.hh>
63 std::shared_ptr<nix::Store>
store;
89 :
store( static_cast<std::shared_ptr<nix::Store>>(
store ) )
108 if ( this->store ==
nullptr ) { this->store = nix::openStore(); }
109 return static_cast<nix::ref<nix::Store>
>( this->
store );
131 std::shared_ptr<nix::EvalState>
state;
153 nix::ref<nix::EvalState>
156 if ( this->state ==
nullptr )
158 this->state = std::make_shared<nix::EvalState>( nix::SearchPath(),
161 this->state->repair = nix::NoRepair;
163 return static_cast<nix::ref<nix::EvalState>
>( this->
state );
Runtime state containing a nix store connection and a nix evaluator.
Definition: nix-state.hh:123
NixState()=default
Construct NixState using the systems default nix store.
nix::ref< nix::EvalState > getState()
Lazily open a nix evaluator.
Definition: nix-state.hh:154
NixState(nix::ref< nix::Store > &store)
Construct NixState from an existing store connection.
Definition: nix-state.hh:145
std::shared_ptr< nix::EvalState > state
Definition: nix-state.hh:131
Mixin which provides a lazy handle to a nix store connection.
Definition: nix-state.hh:59
NixStoreMixin(const nix::ref< nix::Store > &store)
Construct NixStoreMixin from an existing store connection.
Definition: nix-state.hh:88
NixStoreMixin()
Construct NixStoreMixin using the systems default nix store.
Definition: nix-state.hh:97
std::shared_ptr< nix::Store > store
Definition: nix-state.hh:63
nix::ref< nix::Store > getStore()
Lazily open a nix store connection.
Definition: nix-state.hh:106
Interfaces for use by flox.
Definition: command.cc:29
nix::Logger * makeFilteredLogger(bool printBuildLogs)
Create a custom nix::Logger which ignores some messages.
Definition: logger.cc:229
void initNix()
Perform one time nix global runtime setup.
Definition: nix-state.cc:30