diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-11-22T15·06+0100 |
---|---|---|
committer | glittershark <grfn@gws.fyi> | 2020-09-01T02·21+0000 |
commit | 785cb3a75476033ba6eec2fef334d47d8e64388a (patch) | |
tree | 676d53868e29e0ab28443b9d13019c54754012f7 /third_party/nix/src/libstore/globals.hh | |
parent | c5f3b12f0484cd1a5152b6c64a336e9852d7c484 (diff) |
refactor(tvix): getEnv(): Return std::optional r/1756
This allows distinguishing between an empty value and no value. Patch ported from upstream at https://github.com/NixOS/nix/commit/ba87b08f8529e4d9f8c58d8c625152058ceadb75 Change-Id: I061cc8e16b1a7a0341adfc3b0edca1c0c51d5c97 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1884 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
Diffstat (limited to 'third_party/nix/src/libstore/globals.hh')
-rw-r--r-- | third_party/nix/src/libstore/globals.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/globals.hh b/third_party/nix/src/libstore/globals.hh index 54defff06bd1..29848fbb4b7a 100644 --- a/third_party/nix/src/libstore/globals.hh +++ b/third_party/nix/src/libstore/globals.hh @@ -61,8 +61,8 @@ class Settings : public Config { /* File name of the socket the daemon listens to. */ Path nixDaemonSocketFile; - Setting<std::string> storeUri{this, getEnv("NIX_REMOTE", "auto"), "store", - "The default Nix store to use."}; + Setting<std::string> storeUri{this, getEnv("NIX_REMOTE").value_or("auto"), + "store", "The default Nix store to use."}; Setting<bool> keepFailed{ this, false, "keep-failed", |