Flox Package Database 1
CRUD Operations on Nix Package Metadata
|
A set of user defined requirements describing a package/dependency. More...
#include <descriptor.hh>
Public Types | |
using | Path = std::variant< std::string, flox::AttrPath > |
A dot separated attribut path, or list representation. | |
using | AbsPath = std::variant< std::string, AttrPathGlob > |
A dot separated attribut path, or list representation. May contain null members to represent globs. | |
Public Member Functions | |
void | check (const std::string iid="*") const |
Ensure that a raw descriptor's fields are valid or throws an exception if the descriptor is invalid. | |
void | clear () |
Reset to default/empty state. | |
ManifestDescriptorRaw (const std::string_view &descriptor) | |
Public Attributes | |
std::optional< std::string > | name |
std::optional< std::string > | version |
std::optional< Path > | path |
std::optional< AbsPath > | absPath |
std::optional< std::vector< System > > | systems |
std::optional< bool > | optional |
std::optional< GroupName > | packageGroup |
std::optional< std::variant< std::string, nix::fetchers::Attrs > > | packageRepository |
std::optional< unsigned > | priority |
Static Public Attributes | |
static const auto | inputSigil = ':' |
static const auto | versionSigil = '@' |
static const auto | exactVersionSigil = '=' |
A set of user defined requirements describing a package/dependency.
This raw struct is defined to generate parsers. The real form is flox::resolver::ManifestDescriptor.
using flox::resolver::ManifestDescriptorRaw::AbsPath = std::variant<std::string, AttrPathGlob> |
A dot separated attribut path, or list representation. May contain null
members to represent globs.
NOTE: AttrPathGlob
is a std::vector<std::optional<std::string>>
which represnts an absolute attribute path which may have std::nullopt
as its second element to avoid indicating a particular system.
void flox::resolver::ManifestDescriptorRaw::check | ( | const std::string | iid = "*" | ) | const |
Ensure that a raw descriptor's fields are valid or throws an exception if the descriptor is invalid.
This requires that the abspath
field is valid, and consistent with path
and/or systems
fields if they are set.
std::optional<AbsPath> flox::resolver::ManifestDescriptorRaw::absPath |
Match an absolute path, allowing globs for system
.
|
static |
The signifier that the version should be treated exactly i.e. not a semver range
|
static |
The delimiter for providing an input when the descriptor is a string
std::optional<std::string> flox::resolver::ManifestDescriptorRaw::name |
Match name
, pname
, or attrName
. Maps to flox::pkgdb::PkgQueryArgs::pnameOrAttrName
.
std::optional<bool> flox::resolver::ManifestDescriptorRaw::optional |
Whether resoution is allowed to fail without producing errors.
std::optional<GroupName> flox::resolver::ManifestDescriptorRaw::packageGroup |
Named group that the package is a member of.
std::optional<std::variant<std::string, nix::fetchers::Attrs> > flox::resolver::ManifestDescriptorRaw::packageRepository |
Force resolution is the named input or flake reference.
std::optional<Path> flox::resolver::ManifestDescriptorRaw::path |
Match a relative path.
std::optional<unsigned> flox::resolver::ManifestDescriptorRaw::priority |
Rank a package's priority for handling conflicting files. The default value is 5
( set in flox::resolver::ManifestDescriptor ).
Packages with higher priority values will take precendence over those with lower priority values.
std::optional<std::vector<System> > flox::resolver::ManifestDescriptorRaw::systems |
Only resolve for a given set of systems.
std::optional<std::string> flox::resolver::ManifestDescriptorRaw::version |
Match version
or semver
if a modifier is present.
Strings beginning with an =
will filter by exact match on version
. Any string which may be interpreted as a semantic version range will filter on the semver
field. All other strings will filter by exact match on version
.
|
static |
The delimiter for specifying a version when the descriptor is a string