Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::AbstractConfig Class Referenceabstract
Inheritance diagram for nix::AbstractConfig:
nix::Config nix::GlobalConfig nix::ArchiveSettings nix::AuthorizationSettings nix::AutoAllocateUidSettings nix::CompatibilitySettings nix::DevelopSettings nix::EnvSettings nix::EvalSettings nix::ExperimentalFeatureSettings nix::FileTransferSettings nix::GCSettings nix::LocalSettings nix::LogFileSettings nix::LoggerSettings nix::NarInfoDiskCacheSettings nix::PluginSettings nix::Settings nix::StoreConfigBase nix::UpgradeSettings nix::WorkerSettings nix::fetchers::Settings nix::flake::Settings

Classes

struct  SettingInfo

Public Member Functions

virtual bool set (const std::string &name, const std::string &value)=0
virtual void getSettings (std::map< std::string, SettingInfo > &res, bool overriddenOnly=false) const =0
void applyConfig (const std::string &contents, const std::string &path="<unknown>")
virtual void resetOverridden ()=0
virtual nlohmann::json toJSON ()=0
virtual std::string toKeyValue (bool overriddenOnly=false)=0
virtual void convertToArgs (Args &args, const std::string &category)=0
void warnUnknownSettings ()
void reapplyUnknownSettings ()

Protected Member Functions

 AbstractConfig (StringMap initials={})

Protected Attributes

StringMap unknownSettings

Member Function Documentation

◆ applyConfig()

void nix::AbstractConfig::applyConfig ( const std::string & contents,
const std::string & path = "<unknown>" )

Parses the configuration in contents and applies it

  • contents: configuration contents to be parsed and applied
  • path: location of the configuration file

◆ convertToArgs()

virtual void nix::AbstractConfig::convertToArgs ( Args & args,
const std::string & category )
pure virtual

Converts settings to Args to be used on the command line interface

  • args: args to write to
  • category: category of the settings

Implemented in nix::Config, and nix::GlobalConfig.

◆ getSettings()

virtual void nix::AbstractConfig::getSettings ( std::map< std::string, SettingInfo > & res,
bool overriddenOnly = false ) const
pure virtual

Adds the currently known settings to the given result map res.

  • res: map to store settings in
  • overriddenOnly: when set to true only overridden settings will be added to res

Implemented in nix::Config, and nix::GlobalConfig.

◆ reapplyUnknownSettings()

void nix::AbstractConfig::reapplyUnknownSettings ( )

Re-applies all previously attempted changes to unknown settings

◆ resetOverridden()

virtual void nix::AbstractConfig::resetOverridden ( )
pure virtual

Resets the overridden flag of all Settings

Implemented in nix::Config, and nix::GlobalConfig.

◆ set()

virtual bool nix::AbstractConfig::set ( const std::string & name,
const std::string & value )
pure virtual

Sets the value referenced by name to value. Returns true if the setting is known, false otherwise.

Implemented in nix::Config, and nix::GlobalConfig.

◆ toJSON()

virtual nlohmann::json nix::AbstractConfig::toJSON ( )
pure virtual

Outputs all settings to JSON

  • out: JSONObject to write the configuration to

Implemented in nix::Config, and nix::GlobalConfig.

◆ toKeyValue()

virtual std::string nix::AbstractConfig::toKeyValue ( bool overriddenOnly = false)
pure virtual

Outputs all settings in a key-value pair format suitable to be used as nix.conf

Implemented in nix::Config, and nix::GlobalConfig.

◆ warnUnknownSettings()

void nix::AbstractConfig::warnUnknownSettings ( )

Logs a warning for each unregistered setting


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