Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::GCSettings Struct Reference
Inheritance diagram for nix::GCSettings:
nix::Config nix::AbstractConfig nix::LocalSettings nix::Settings

Public Attributes

Setting< off_t > reservedSize
Setting< bool > keepOutputs
Setting< bool > keepDerivations
Setting< uint64_t > minFree
Setting< uint64_t > maxFree
Setting< uint64_t > minFreeCheckInterval

Additional Inherited Members

Public Types inherited from nix::Config
using Settings = std::map<std::string, SettingData>
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 ()
Protected Member Functions inherited from nix::AbstractConfig
 AbstractConfig (StringMap initials={})
Protected Attributes inherited from nix::AbstractConfig
StringMap unknownSettings

Member Data Documentation

◆ keepDerivations

Setting<bool> nix::GCSettings::keepDerivations
Initial value:
{
this,
true,
"keep-derivations",
R"(
If `true` (default), the garbage collector keeps the derivations
from which non-garbage store paths were built. If `false`, they are
deleted unless explicitly registered as a root (or reachable from
other roots).
Keeping derivation around is useful for querying and traceability
(e.g., it allows you to ask with what dependencies or options a
store path was built), so by default this option is on. Turn it off
to save a bit of disk space (or a lot if `keep-outputs` is also
turned on).
This option only applies to garbage collection of the whole store
and does not affect deleting explicit paths.
)",
{"gc-keep-derivations"},
}

◆ keepOutputs

Setting<bool> nix::GCSettings::keepOutputs
Initial value:
{
this,
false,
"keep-outputs",
R"(
If `true`, the garbage collector keeps the outputs of
non-garbage derivations. If `false` (default), outputs are
deleted unless they are GC roots themselves (or reachable from other
roots).
In general, outputs must be registered as roots separately. However,
even if the output of a derivation is registered as a root, the
collector still deletes store paths that are used only at build
time (e.g., the C compiler, or source tarballs downloaded from the
network). To prevent it from doing so, set this option to `true`.
This option only applies to garbage collection of the whole store
and does not affect deleting explicit paths.
)",
{"gc-keep-outputs"},
}

◆ maxFree

Setting<uint64_t> nix::GCSettings::maxFree
Initial value:
{
this,
std::numeric_limits<int64_t>::max(),
"max-free",
R"(
When a garbage collection is triggered by the `min-free` option, it
stops as soon as `max-free` bytes are available. The default is
infinity (i.e. delete all garbage).
)",
}

◆ minFree

Setting<uint64_t> nix::GCSettings::minFree
Initial value:
{
this,
0,
"min-free",
R"(
When free disk space in `/nix/store` drops below `min-free` during a
build, Nix performs a garbage-collection until `max-free` bytes are
available or there is no more garbage. A value of `0` (the default)
disables this feature.
)",
}

◆ minFreeCheckInterval

Setting<uint64_t> nix::GCSettings::minFreeCheckInterval
Initial value:
{
this,
5,
"min-free-check-interval",
"Number of seconds between checking free disk space.",
}

◆ reservedSize

Setting<off_t> nix::GCSettings::reservedSize
Initial value:
{
this,
8 * 1024 * 1024,
"gc-reserved-space",
"Amount of reserved disk space for the garbage collector.",
}

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