aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-27 19:06:58 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-27 19:06:58 +0000
commite023c985d58094041e74ff59a51757bc75687ca7 (patch)
tree8865872040ac8752c8349b73fa71b82e80dc2584 /src/libstore/globals.hh
parentd3cfc14e3a370116e5715d5de5f64ed34dd2f912 (diff)
parent906adadacd2d1c98346a2f42c0b42a32d2806d94 (diff)
Merge remote-tracking branch 'upstream/master' into auto-uid-allocation
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r--src/libstore/globals.hh65
1 files changed, 40 insertions, 25 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index aa1fbdeb7..fa8e74b59 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -25,7 +25,33 @@ struct MaxBuildJobsSetting : public BaseSetting<unsigned int>
options->addSetting(this);
}
- void set(const std::string & str) override;
+ void set(const std::string & str, bool append = false) override;
+};
+
+struct PluginFilesSetting : public BaseSetting<Paths>
+{
+ bool pluginsLoaded = false;
+
+ PluginFilesSetting(Config * options,
+ const Paths & def,
+ const std::string & name,
+ const std::string & description,
+ const std::set<std::string> & aliases = {})
+ : BaseSetting<Paths>(def, name, description, aliases)
+ {
+ options->addSetting(this);
+ }
+
+ void set(const std::string & str, bool append = false) override;
+};
+
+class MissingExperimentalFeature: public Error
+{
+public:
+ std::string missingFeature;
+
+ MissingExperimentalFeature(std::string feature);
+ virtual const char* sname() const override { return "MissingExperimentalFeature"; }
};
class Settings : public Config {
@@ -34,6 +60,8 @@ class Settings : public Config {
StringSet getDefaultSystemFeatures();
+ StringSet getDefaultExtraPlatforms();
+
bool isWSL1();
public:
@@ -178,7 +206,10 @@ public:
Setting<std::string> builders{
this, "@" + nixConfDir + "/machines", "builders",
- "A semicolon-separated list of build machines, in the format of `nix.machines`."};
+ R"(
+ A semicolon-separated list of build machines.
+ For the exact format and examples, see [the manual chapter on remote builds](../advanced-topics/distributed-builds.md)
+ )"};
Setting<bool> buildersUseSubstitutes{
this, false, "builders-use-substitutes",
@@ -426,14 +457,6 @@ public:
Setting<bool> sandboxFallback{this, true, "sandbox-fallback",
"Whether to disable sandboxing when the kernel doesn't allow it."};
- Setting<PathSet> extraSandboxPaths{
- this, {}, "extra-sandbox-paths",
- R"(
- A list of additional paths appended to `sandbox-paths`. Useful if
- you want to extend its default value.
- )",
- {"build-extra-chroot-dirs", "build-extra-sandbox-paths"}};
-
Setting<size_t> buildRepeat{
this, 0, "repeat",
R"(
@@ -566,7 +589,7 @@ public:
Setting<StringSet> extraPlatforms{
this,
- std::string{SYSTEM} == "x86_64-linux" && !isWSL1() ? StringSet{"i686-linux"} : StringSet{},
+ getDefaultExtraPlatforms(),
"extra-platforms",
R"(
Platforms other than the native one which this machine is capable of
@@ -604,7 +627,7 @@ public:
Setting<Strings> substituters{
this,
- nixStore == "/nix/store" ? Strings{"https://cache.nixos.org/"} : Strings(),
+ Strings{"https://cache.nixos.org/"},
"substituters",
R"(
A list of URLs of substituters, separated by whitespace. The default
@@ -612,17 +635,6 @@ public:
)",
{"binary-caches"}};
- // FIXME: provide a way to add to option values.
- Setting<Strings> extraSubstituters{
- this, {}, "extra-substituters",
- R"(
- Additional binary caches appended to those specified in
- `substituters`. When used by unprivileged users, untrusted
- substituters (i.e. those not listed in `trusted-substituters`) are
- silently ignored.
- )",
- {"extra-binary-caches"}};
-
Setting<StringSet> trustedSubstituters{
this, {}, "trusted-substituters",
R"(
@@ -849,7 +861,7 @@ public:
Setting<uint64_t> minFreeCheckInterval{this, 5, "min-free-check-interval",
"Number of seconds between checking free disk space."};
- Setting<Paths> pluginFiles{
+ PluginFilesSetting pluginFiles{
this, {}, "plugin-files",
R"(
A list of plugin files to be loaded by Nix. Each of these files will
@@ -861,6 +873,9 @@ public:
command, and RegisterSetting to add new nix config settings. See the
constructors for those types for more details.
+ Warning! These APIs are inherently unstable and may change from
+ release to release.
+
Since these files are loaded into the same address space as Nix
itself, they must be DSOs compatible with the instance of Nix
running at the time (i.e. compiled against the same headers, not
@@ -899,7 +914,7 @@ public:
Example `~/.config/nix/nix.conf`:
```
- access-tokens = "github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk"
+ access-tokens = github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk
```
Example `~/code/flake.nix`: