Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::S3BinaryCacheStoreConfig Struct Reference
Inheritance diagram for nix::S3BinaryCacheStoreConfig:
nix::HttpBinaryCacheStoreConfig nix::StoreConfig nix::BinaryCacheStoreConfig nix::StoreConfigBase nix::StoreDirConfig nix::StoreConfig nix::Config nix::StoreConfigBase nix::StoreDirConfig nix::AbstractConfig nix::Config nix::AbstractConfig

Public Member Functions

 S3BinaryCacheStoreConfig (const Params &params)
 S3BinaryCacheStoreConfig (ParsedURL cacheUri, const Params &params)
 S3BinaryCacheStoreConfig (std::string_view bucketName, const Params &params)
std::string getHumanReadableURI () const override
ref< Store > openStore () const override
Public Member Functions inherited from nix::HttpBinaryCacheStoreConfig
 HttpBinaryCacheStoreConfig (const Params &params)
 HttpBinaryCacheStoreConfig (ParsedURL cacheUri, const Store::Config::Params &params)
ref< Store > openStore (ref< FileTransfer > fileTransfer) const
StoreReference getReference () const override
Public Member Functions inherited from nix::StoreConfig
 StoreConfig (const Params &params, FilePathType pathType)
StringMap getQueryParams () const
virtual bool getReadOnly () const
virtual const std::filesystem::path & getStateDir () const
virtual const std::filesystem::path & getLogDir () const
Public Member Functions inherited from nix::StoreConfigBase
 StoreConfigBase (const StoreReference::Params &params, FilePathType pathType)
Public Member Functions inherited from nix::Config
 Config (StringMap initials={})
bool set (const std::string &name, const std::string &value) override
void addSetting (AbstractSetting *setting)
void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false) const override
void resetOverridden () override
nlohmann::json toJSON () override
std::string toKeyValue (bool overriddenOnly=false) override
void convertToArgs (Args &args, const std::string &category) override
Public Member Functions inherited from nix::AbstractConfig
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
void warnUnknownSettings ()
void reapplyUnknownSettings ()
Public Member Functions inherited from nix::StoreDirConfig
StorePath parseStorePath (std::string_view path) const
StorePath parseStorePathCanonical (std::string_view path) const
std::optional< StorePath > maybeParseStorePath (std::string_view path) const
std::string printStorePath (const StorePath &path) const
StringSet printStorePathSet (const StorePathSet &path) const
std::size_t maxCanonicalStorePathLen () const noexcept
bool isInStore (std::string_view path) const
bool isStorePath (std::string_view path) const
std::pair< StorePath, CanonPath > toStorePath (std::string_view path) const
StorePath makeStorePath (std::string_view type, std::string_view hash, std::string_view name) const
StorePath makeStorePath (std::string_view type, const Hash &hash, std::string_view name) const
StorePath makeOutputPath (std::string_view id, const Hash &hash, std::string_view name) const
StorePath makeFixedOutputPath (std::string_view name, const FixedOutputInfo &info) const
StorePath makeFixedOutputPathFromCA (std::string_view name, const ContentAddressWithReferences &ca) const
std::pair< StorePath, Hash > computeStorePath (std::string_view name, const SourcePath &path, ContentAddressMethod method=ContentAddressMethod::Raw::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const
Public Member Functions inherited from nix::BinaryCacheStoreConfig
 BinaryCacheStoreConfig (const Params &params)

Static Public Member Functions

static const std::string name ()
static StringSet uriSchemes ()
static std::string doc ()
Static Public Member Functions inherited from nix::HttpBinaryCacheStoreConfig
static const std::string name ()
static StringSet uriSchemes ()
static std::string doc ()
Static Public Member Functions inherited from nix::StoreConfig
static StringSet getDefaultSystemFeatures ()
static std::string doc ()
static std::optional< ExperimentalFeature > experimentalFeature ()

Public Attributes

Setting< std::string > profile
Setting< std::string > region
Setting< std::string > scheme
Setting< std::string > endpoint
Setting< S3AddressingStyle > addressingStyle
Setting< bool > multipartUpload
Setting< uint64_t > multipartChunkSize
Setting< uint64_t > multipartThreshold
Setting< std::optional< std::string > > storageClass
const std::set< const AbstractSetting * > s3UriSettings = {&profile, &region, &scheme, &endpoint, &addressingStyle}
Public Attributes inherited from nix::HttpBinaryCacheStoreConfig
ParsedURL cacheUri
Setting< std::optional< CompressionAlgo > > narinfoCompression
Setting< std::optional< CompressionAlgo > > lsCompression
Setting< std::optional< CompressionAlgo > > logCompression
Setting< std::optional< AbsolutePath > > tlsCert
Setting< std::optional< AbsolutePath > > tlsKey
Setting< uint32_t > retryDelayMs
Setting< uint32_t > retryDelayRateLimitedMs
Setting< uint32_t > retryMaxDelayMs
Setting< uint32_t > retryAttempts
Public Attributes inherited from nix::StoreConfig
Setting< int > pathInfoCacheSize
Setting< bool > isTrusted
Setting< int > priority
Setting< bool > wantMassQuery
Setting< StringSet > systemFeatures
Public Attributes inherited from nix::StoreConfigBase
StoreDirSetting storeDir_
Public Attributes inherited from nix::StoreDirConfig
const std::string & storeDir
Public Attributes inherited from nix::BinaryCacheStoreConfig
Setting< CompressionAlgo > compression
Setting< bool > writeNARListing
Setting< bool > writeDebugInfo
Setting< std::optional< AbsolutePath > > secretKeyFile
Setting< std::string > secretKeyFiles
Setting< std::optional< AbsolutePath > > localNarCache
Setting< bool > parallelCompression
Setting< int > compressionLevel

Additional Inherited Members

Public Types inherited from nix::StoreConfig
using Params = StoreReference::Params
Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
Protected Types inherited from nix::StoreConfigBase
enum struct  FilePathType { Unix , Native }
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Member Function Documentation

◆ getHumanReadableURI()

std::string nix::S3BinaryCacheStoreConfig::getHumanReadableURI ( ) const
overridevirtual

Get a textual representation of the store reference.

Warning
This is only suitable for logging or error messages. This will not roundtrip when parsed as a StoreReference. Must NOT be used as a cache key or otherwise be relied upon to be stable.

Can be implemented by subclasses to make the URI more legible, e.g. when some query parameters are necessary to make sense of the URI.

Reimplemented from nix::StoreConfig.

◆ openStore()

ref< Store > nix::S3BinaryCacheStoreConfig::openStore ( ) const
overridevirtual

Open a store of the type corresponding to this configuration type.

Reimplemented from nix::HttpBinaryCacheStoreConfig.

Member Data Documentation

◆ addressingStyle

Setting<S3AddressingStyle> nix::S3BinaryCacheStoreConfig::addressingStyle
Initial value:
{
this,
S3AddressingStyle::Auto,
"addressing-style",
R"(
The S3 addressing style to use. `auto` (default) uses
virtual-hosted-style for standard AWS endpoints and path-style
for custom endpoints; bucket names containing dots automatically
fall back to path-style to avoid TLS certificate errors. `path`
forces path-style addressing (deprecated by AWS). `virtual`
forces virtual-hosted-style addressing (bucket names must not
contain dots).
)"}

◆ endpoint

Setting<std::string> nix::S3BinaryCacheStoreConfig::endpoint
Initial value:
{
this,
"",
"endpoint",
R"(
The S3 endpoint to use. When empty (default), uses AWS S3 with
region-specific endpoints. For S3-compatible services such as
MinIO, set this to your service's endpoint as a full URL,
e.g. `https://minio.example.com` or `http://localhost:9000`.
)"}

◆ multipartChunkSize

Setting<uint64_t> nix::S3BinaryCacheStoreConfig::multipartChunkSize
Initial value:
{
this,
5 * 1024 * 1024,
"multipart-chunk-size",
R"(
The size (in bytes) of each part in multipart uploads. Must be
at least 5 MiB (AWS S3 requirement). Larger chunk sizes reduce the
number of requests but use more memory. Default is 5 MiB.
)",
{"buffer-size"}}

◆ multipartThreshold

Setting<uint64_t> nix::S3BinaryCacheStoreConfig::multipartThreshold
Initial value:
{
this,
100 * 1024 * 1024,
"multipart-threshold",
R"(
The minimum file size (in bytes) for using multipart uploads.
Files smaller than this threshold will use regular PUT requests.
Default is 100 MiB. Only takes effect when multipart-upload is enabled.
)"}

◆ multipartUpload

Setting<bool> nix::S3BinaryCacheStoreConfig::multipartUpload
Initial value:
{
this,
false,
"multipart-upload",
R"(
Whether to use multipart uploads for large files. When enabled,
files exceeding the multipart threshold will be uploaded in
multiple parts, which is required for files larger than 5 GiB and
can improve performance and reliability for large uploads.
)"}

◆ profile

Setting<std::string> nix::S3BinaryCacheStoreConfig::profile
Initial value:
{
this,
"default",
"profile",
R"(
The name of the AWS configuration profile to use. By default
Nix uses the `default` profile.
)"}

◆ region

Setting<std::string> nix::S3BinaryCacheStoreConfig::region
Initial value:
{
this,
"us-east-1",
"region",
R"(
The region of the S3 bucket. If your bucket is not in
`us-east-1`, you should always explicitly specify the region
parameter.
)"}

◆ s3UriSettings

const std::set<const AbstractSetting *> nix::S3BinaryCacheStoreConfig::s3UriSettings = {&profile, &region, &scheme, &endpoint, &addressingStyle}

Set of settings that are part of the S3 URI itself. These are needed for region specification and other S3-specific settings.

◆ scheme

Setting<std::string> nix::S3BinaryCacheStoreConfig::scheme
Initial value:
{
this,
"https",
"scheme",
R"(
Deprecated: specify the scheme as part of the `endpoint` URL
instead, e.g. `endpoint=http://localhost:9000`.
The scheme used for S3 requests, `https` (default) or `http`. This
option allows you to disable HTTPS for binary caches which don't
support it.
> **Note**
>
> HTTPS should be used if the cache might contain sensitive
> information.
)"}

◆ storageClass

Setting<std::optional<std::string> > nix::S3BinaryCacheStoreConfig::storageClass
Initial value:
{
this,
std::nullopt,
"storage-class",
R"(
The S3 storage class to use for uploaded objects. When not set (default),
uses the bucket's default storage class. Valid values include:
- STANDARD (default, frequently accessed data)
- REDUCED_REDUNDANCY (less frequently accessed data)
- STANDARD_IA (infrequent access)
- ONEZONE_IA (infrequent access, single AZ)
- INTELLIGENT_TIERING (automatic cost optimization)
- GLACIER (archival with retrieval times in minutes to hours)
- DEEP_ARCHIVE (long-term archival with 12-hour retrieval)
- GLACIER_IR (instant retrieval archival)
See AWS S3 documentation for detailed storage class descriptions and pricing:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html
)"}

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