aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.hh
diff options
context:
space:
mode:
authorMatej Urbas <matej.urbas@gmail.com>2023-04-30 09:56:24 +0100
committerMatej Urbas <matej.urbas@gmail.com>2023-05-07 20:22:18 +0100
commit613bc699bb72d32c7d0622bf2996b2ecc8012455 (patch)
treeced1d97b8d86ad4e14135204ab4a0bcee6c6b146 /src/libstore/globals.hh
parent89d3cc5a47a448f624ea4c9b43eeee00dcc88a21 (diff)
`max-substitution-jobs` setting
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r--src/libstore/globals.hh27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 609cf53b8..f1e1e4b22 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -29,6 +29,21 @@ struct MaxBuildJobsSetting : public BaseSetting<unsigned int>
unsigned int parse(const std::string & str) const override;
};
+struct MaxSubstitutionJobsSetting : public BaseSetting<unsigned int>
+{
+ MaxSubstitutionJobsSetting(Config * options,
+ unsigned int def,
+ const std::string & name,
+ const std::string & description,
+ const std::set<std::string> & aliases = {})
+ : BaseSetting<unsigned int>(def, true, name, description, aliases)
+ {
+ options->addSetting(this);
+ }
+
+ unsigned int parse(const std::string & str) const override;
+};
+
struct PluginFilesSetting : public BaseSetting<Paths>
{
bool pluginsLoaded = false;
@@ -159,6 +174,18 @@ public:
)",
{"build-max-jobs"}};
+ MaxSubstitutionJobsSetting maxSubstitutionJobs{
+ this, 16, "max-substitution-jobs",
+ R"(
+ This option defines the maximum number of substitution jobs that Nix
+ will try to run in parallel. The default is `16`. The minimum value
+ one can choose is `1` and lower values will be interpreted as `1`. The
+ special value `auto` causes Nix to use the number of CPUs in your
+ system. It can be overridden using the `--max-substitution-jobs`
+ command line switch.
+ )",
+ {"substitution-max-jobs"}};
+
Setting<unsigned int> buildCores{
this,
getDefaultCores(),