14#include <nlohmann/json_fwd.hpp>
22#include <nix/flake/flake.hh>
23#include <nix/flake/flakeref.hh>
73 std::shared_ptr<PkgDbReadOnly>
dbRO;
79 std::shared_ptr<PkgDb>
dbRW;
82 std::optional<std::string>
name;
124 std::filesystem::path
dbPath,
127 const std::string &
name =
"" )
130 ,
name(
name.empty() ? std::nullopt : std::make_optional(
name ) )
147 const std::string &
name =
"" )
151 ,
name(
name.empty() ? std::nullopt : std::make_optional(
name ) )
159 [[nodiscard]] nix::ref<PkgDbReadOnly>
162 return static_cast<nix::ref<PkgDbReadOnly>
>( this->
dbRO );
169 [[nodiscard]] nix::ref<PkgDb>
176 this->dbRW =
nullptr;
180 [[nodiscard]] std::filesystem::path
219 [[nodiscard]] std::string
222 return this->name.value_or(
223 this->
getFlake()->lockedFlake.flake.lockedRef.to_string() );
227 [[nodiscard]] nlohmann::json
258 [[nodiscard]] std::shared_ptr<PkgDbInput>
261 return std::make_shared<PkgDbInput>( this->store,
291 std::shared_ptr<Registry<PkgDbInputFactory>> registry;
324 [[nodiscard]]
virtual const std::vector<System> &
336 [[nodiscard]] nix::ref<Registry<PkgDbInputFactory>>
Mixin which provides a lazy handle to a nix store connection.
Definition: nix-state.hh:59
Provides a registry of PkgDb managers.
Definition: input.hh:283
nix::ref< Registry< PkgDbInputFactory > > getPkgDbRegistry()
Get the set of package databases to resolve in.
Definition: input.cc:219
void setPkgDbForced(bool force)
Set whether DBs will be regenerated from scratch.
Definition: input.hh:348
bool force
Definition: input.hh:295
virtual const std::vector< System > & getSystems()=0
void initRegistry()
Initialize registry member from params.registry.
Definition: input.cc:189
virtual RegistryRaw getRegistryRaw()=0
bool isPkgDbForced() const
Whether DBs will be regenerated from scratch.
Definition: input.hh:341
void scrapeIfNeeded()
Lazily perform scraping on input flakes.
Definition: input.cc:205
Defines a convenience wrapper that provides various operations on a flake.
Interfaces for caching package metadata in SQLite3 databases.
Definition: command.cc:44
std::filesystem::path genPkgDbName(const Fingerprint &fingerprint, const std::filesystem::path &cacheDir)
Get an absolute path to the ‘PkgDb’ for a given fingerprint hash.
Definition: read.cc:76
std::filesystem::path getPkgDbCachedir()
Get the default pkgdb cache directory to save databases.
Definition: read.cc:53
uint64_t row_id
Definition: pkg-query.hh:48
std::vector< std::string > AttrPath
A list of key names addressing a location in a nested JSON-like object.
Definition: types.hh:33
Manages a nix runtime state blob with associated helpers.
Interfaces for constructing complex ‘Packages’ queries.
Interfaces for reading a SQLite3 package set database.
A set of user inputs used to set input preferences during search and resolution.
A set of user inputs used to set input preferences during search and resolution.
Definition: registry.hh:297
Miscellaneous typedefs and aliases.