aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-12 23:00:18 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-12 23:00:18 +0000
commitbdc772022766e65fa8ea6d29fff0735529ab47f3 (patch)
treed12a08d6a29d929fb646571e65bbd68bf009f3d4 /src/libstore/globals.hh
parent6c7b81047f8ead0bb2f8dd588dfcb5f50d1554a9 (diff)
parent20d2140e450b066a521933dd322d089fd6c248fa (diff)
Merge branch 'master' of github.com:NixOS/nix into trustless-remote-builder-simple
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r--src/libstore/globals.hh63
1 files changed, 61 insertions, 2 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 8a2d3ff75..8c63c5b34 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -859,8 +859,54 @@ public:
are loaded as plugins (non-recursively).
)"};
- Setting<std::string> githubAccessToken{this, "", "github-access-token",
- "GitHub access token to get access to GitHub data through the GitHub API for `github:<..>` flakes."};
+ Setting<StringMap> accessTokens{this, {}, "access-tokens",
+ R"(
+ Access tokens used to access protected GitHub, GitLab, or
+ other locations requiring token-based authentication.
+
+ Access tokens are specified as a string made up of
+ space-separated `host=token` values. The specific token
+ used is selected by matching the `host` portion against the
+ "host" specification of the input. The actual use of the
+ `token` value is determined by the type of resource being
+ accessed:
+
+ * Github: the token value is the OAUTH-TOKEN string obtained
+ as the Personal Access Token from the Github server (see
+ https://docs.github.com/en/developers/apps/authorizing-oath-apps).
+
+ * Gitlab: the token value is either the OAuth2 token or the
+ Personal Access Token (these are different types tokens
+ for gitlab, see
+ https://docs.gitlab.com/12.10/ee/api/README.html#authentication).
+ The `token` value should be `type:tokenstring` where
+ `type` is either `OAuth2` or `PAT` to indicate which type
+ of token is being specified.
+
+ Example `~/.config/nix/nix.conf`:
+
+ ```
+ access-tokens = "github.com=23ac...b289 gitlab.mycompany.com=PAT:A123Bp_Cd..EfG gitlab.com=OAuth2:1jklw3jk"
+ ```
+
+ Example `~/code/flake.nix`:
+
+ ```nix
+ input.foo = {
+ type = "gitlab";
+ host = "gitlab.mycompany.com";
+ owner = "mycompany";
+ repo = "pro";
+ };
+ ```
+
+ This example specifies three tokens, one each for accessing
+ github.com, gitlab.mycompany.com, and sourceforge.net.
+
+ The `input.foo` uses the "gitlab" fetcher, which might
+ requires specifying the token type along with the token
+ value.
+ )"};
Setting<Strings> experimentalFeatures{this, {}, "experimental-features",
"Experimental Nix features to enable."};
@@ -880,6 +926,19 @@ public:
Setting<std::string> flakeRegistry{this, "https://github.com/NixOS/flake-registry/raw/master/flake-registry.json", "flake-registry",
"Path or URI of the global flake registry."};
+
+ Setting<bool> allowSymlinkedStore{
+ this, false, "allow-symlinked-store",
+ R"(
+ If set to `true`, Nix will stop complaining if the store directory
+ (typically /nix/store) contains symlink components.
+
+ This risks making some builds "impure" because builders sometimes
+ "canonicalise" paths by resolving all symlink components. Problems
+ occur if those builds are then deployed to machines where /nix/store
+ resolves to a different location from that of the build machine. You
+ can enable this setting if you are sure you're not going to do that.
+ )"};
};