Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::UnkeyedValidPathInfo Struct Reference

#include <path-info.hh>

Inheritance diagram for nix::UnkeyedValidPathInfo:
nix::UnkeyedNarInfo nix::ValidPathInfo nix::NarInfo nix::NarInfo

Public Member Functions

 UnkeyedValidPathInfo (const UnkeyedValidPathInfo &other)=default
 UnkeyedValidPathInfo (const StoreDirConfig &store, Hash narHash)
 UnkeyedValidPathInfo (std::string storeDir, Hash narHash)
bool operator== (const UnkeyedValidPathInfo &) const noexcept
std::weak_ordering operator<=> (const UnkeyedValidPathInfo &) const noexcept
virtual nlohmann::json toJSON (const StoreDirConfig *store, bool includeImpureInfo, PathInfoJsonFormat format) const

Static Public Member Functions

static UnkeyedValidPathInfo fromJSON (const StoreDirConfig *store, const nlohmann::json &json)

Public Attributes

std::string storeDir
std::optional< StorePath > deriver
Hash narHash
StorePathSet references
time_t registrationTime = 0
uint64_t narSize = 0
bool ultimate = false
std::set< Signature > sigs
std::optional< ContentAddress > ca

Detailed Description

Information about a store object.

See store/store-object and protocols/json/store-object-info in the Nix manual

Member Function Documentation

◆ operator<=>()

std::weak_ordering nix::UnkeyedValidPathInfo::operator<=> ( const UnkeyedValidPathInfo & ) const
noexcept
Todo
return std::strong_ordering once id is removed

◆ toJSON()

nlohmann::json nix::UnkeyedValidPathInfo::toJSON ( const StoreDirConfig * store,
bool includeImpureInfo,
PathInfoJsonFormat format ) const
virtual
Parameters
storeIf non-null, store paths are rendered as full paths. If null, store paths are rendered as base names.
includeImpureInfoIf true, variable elements such as the registration time are included.
formatJSON format version. Version 1 uses string hashes and string content addresses. Version 2 uses structured hashes and structured content addresses.

Reimplemented in nix::UnkeyedNarInfo.

Member Data Documentation

◆ ca

std::optional<ContentAddress> nix::UnkeyedValidPathInfo::ca

If non-empty, an assertion that the path is content-addressed, i.e., that the store path is computed from a cryptographic hash of the contents of the path, plus some other bits of data like the "name" part of the path. Such a path doesn't need signatures, since we don't have to trust anybody's claim that the path is the output of a particular derivation. (In the extensional store model, we have to trust that the contents of an output path of a derivation were actually produced by that derivation. In the intensional model, we have to trust that a particular output path was produced by a derivation; the path then implies the contents.)

Ideally, the content-addressability assertion would just be a Boolean, and the store path would be computed from the name component, 'narHash' and 'references'. However, we support many types of content addresses.

◆ deriver

std::optional<StorePath> nix::UnkeyedValidPathInfo::deriver

Path to derivation that produced this store object, if known.

◆ narHash

Hash nix::UnkeyedValidPathInfo::narHash
Todo
document this

◆ narSize

uint64_t nix::UnkeyedValidPathInfo::narSize = 0

0 = unknown

◆ references

StorePathSet nix::UnkeyedValidPathInfo::references

Other store objects this store object refers to.

◆ registrationTime

time_t nix::UnkeyedValidPathInfo::registrationTime = 0

When this store object was registered in the store that contains it, if known.

◆ storeDir

std::string nix::UnkeyedValidPathInfo::storeDir

The store directory this store object belongs to.

This supports relocatable store objects where different objects may have different store directories.

◆ ultimate

bool nix::UnkeyedValidPathInfo::ultimate = false

Whether the path is ultimately trusted, that is, it's a derivation output that was built locally.


The documentation for this struct was generated from the following files:
  • libstore/include/nix/store/path-info.hh
  • libstore/path-info.cc