Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::CommonSSHStoreConfig Struct Reference
Inheritance diagram for nix::CommonSSHStoreConfig:
nix::StoreConfig nix::StoreDirConfig nix::Config nix::AbstractConfig nix::LegacySSHStoreConfig nix::SSHStoreConfig nix::LegacySSHStore nix::MountedSSHStoreConfig nix::SSHStore nix::MountedSSHStore nix::MountedSSHStore

Public Member Functions

 CommonSSHStoreConfig (std::string_view scheme, std::string_view host, const Params &params)
 
SSHMaster createSSHMaster (bool useMaster, Descriptor logFD=INVALID_DESCRIPTOR)
 
 StoreConfig ()=delete
 
- Public Member Functions inherited from nix::StoreConfig
virtual const std::string name ()=0
 
virtual std::string doc ()
 
virtual std::optional< ExperimentalFeatureexperimentalFeature () const
 
 StoreDirConfig ()=delete
 
- Public Member Functions inherited from nix::StoreDirConfig
StorePath parseStorePath (std::string_view path) const
 
std::optional< StorePathmaybeParseStorePath (std::string_view path) const
 
std::string printStorePath (const StorePath &path) const
 
StorePathSet parseStorePathSet (const PathSet &paths) const
 
PathSet printStorePathSet (const StorePathSet &path) const
 
std::string showPaths (const StorePathSet &paths)
 
bool isInStore (PathView path) const
 
bool isStorePath (std::string_view path) const
 
std::pair< StorePath, PathtoStorePath (PathView 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, HashcomputeStorePath (std::string_view name, const SourcePath &path, ContentAddressMethod method=FileIngestionMethod::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const
 
 Config (StringMap initials={})
 
- 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) override
 
void resetOverridden () override
 
nlohmann::json toJSON () override
 
std::string toKeyValue () 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 Attributes

const Setting< PathsshKey
 
const Setting< std::string > sshPublicHostKey
 
const Setting< bool > compress
 
const Setting< std::string > remoteStore
 
std::string host
 
- Public Attributes inherited from nix::StoreConfig
const Setting< intpathInfoCacheSize
 
const Setting< bool > isTrusted
 
Setting< intpriority
 
Setting< bool > wantMassQuery
 
Setting< StringSet > systemFeatures
 
- Public Attributes inherited from nix::StoreDirConfig
const PathSetting storeDir_
 
const Path storeDir = storeDir_
 

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>
 
- Static Public Member Functions inherited from nix::StoreConfig
static StringSet getDefaultSystemFeatures ()
 
- Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
 
- Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings
 

Member Function Documentation

◆ createSSHMaster()

SSHMaster nix::CommonSSHStoreConfig::createSSHMaster ( bool useMaster,
Descriptor logFD = INVALID_DESCRIPTOR )

Small wrapper around SSHMaster::SSHMaster that gets most arguments from this configuration.

See that constructor for details on the remaining two arguments.

Member Data Documentation

◆ compress

const Setting<bool> nix::CommonSSHStoreConfig::compress
Initial value:
{this, false, "compress",
"Whether to enable SSH compression."}

◆ host

std::string nix::CommonSSHStoreConfig::host

The parseURL function supports both IPv6 URIs as defined in RFC2732, but also pure addresses. The latter one is needed here to connect to a remote store via SSH (it's possible to do e.g. ssh root@::1).

When initialized, the following adjustments are made:

  • If the URL looks like root@[::1] (which is allowed by the URL parser and probably needed to pass further flags), it will be transformed into root@::1 for SSH (same for [::1] -> ::1).
  • If the URL looks like root@::1 it will be left as-is.
  • In any other case, the string will be left as-is.

Will throw an error if connStr is empty too.

◆ remoteStore

const Setting<std::string> nix::CommonSSHStoreConfig::remoteStore
Initial value:
{this, "", "remote-store",
R"(
[Store URL](@docroot@/store/types/index.md#store-url-format)
to be used on the remote machine. The default is `auto`
(i.e. use the Nix daemon or `/nix/store` directly).
)"}

◆ sshKey

const Setting<Path> nix::CommonSSHStoreConfig::sshKey
Initial value:
{this, "", "ssh-key",
"Path to the SSH private key used to authenticate to the remote machine."}

◆ sshPublicHostKey

const Setting<std::string> nix::CommonSSHStoreConfig::sshPublicHostKey
Initial value:
{this, "", "base64-ssh-public-host-key",
"The public host key of the remote machine."}

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