diff options
author | regnat <rg@regnat.ovh> | 2021-11-05 16:17:49 +0100 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-11-05 16:19:16 +0100 |
commit | 1f3c3a3785b21fe349480b562d5f97b8cc9caa6d (patch) | |
tree | 67693e9b7a0df3321e6942af7f14dac7c1e59ef1 /src/libstore | |
parent | 7d6017b7a911dd5b8a7ccb5bc1bf9282140de20c (diff) |
Make the flake options work when using the daemon
When setting flake-local options (with the `nixConfig` field), forward
these options to the daemon in case we’re using one.
This is necessary in particular for options like `binary-caches` or
`post-build-hook` to make sense.
Fix <https://github.com/NixOS/nix/commit/343239fc8a1993f707a990c2cd54a41f1fa3de99#r44356843>
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/remote-store.cc | 4 | ||||
-rw-r--r-- | src/libstore/remote-store.hh | 2 | ||||
-rw-r--r-- | src/libstore/store-api.hh | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 7decc059c..274203f8d 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -290,6 +290,10 @@ ConnectionHandle RemoteStore::getConnection() return ConnectionHandle(connections->get()); } +void RemoteStore::setOptions() +{ + setOptions(*(getConnection().handle)); +} bool RemoteStore::isValidPathUncached(const StorePath & path) { diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index a3036e6b0..5f6da9af5 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -147,6 +147,8 @@ protected: virtual void setOptions(Connection & conn); + void setOptions() override; + ConnectionHandle getConnection(); friend struct ConnectionHandle; diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 7d02340df..8472e726a 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -724,6 +724,11 @@ public: virtual void createUser(const std::string & userName, uid_t userId) { } + /* + * Synchronises the options of the client with those of the daemon + * (a no-op when there’s no daemon) + */ + virtual void setOptions() { } protected: Stats stats; |