diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-11-08 13:54:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 13:54:55 +0100 |
commit | 736d6ab7214d12e4837424b301a803acae02c273 (patch) | |
tree | 66feabbf7fad765841d50ecc41e91087b9385eaf /src | |
parent | c9ecc0948b872dc5d3c64accccfe6b1c27e83ef0 (diff) | |
parent | 1f3c3a3785b21fe349480b562d5f97b8cc9caa6d (diff) |
Merge pull request #5504 from NixOS/flake-options-and-daemon
Make the flake options work when using the daemon
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/flake/flake.cc | 2 | ||||
-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 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index c9d848495..07ed3caa2 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -307,7 +307,7 @@ LockedFlake lockFlake( if (lockFlags.applyNixConfig) { flake.config.apply(); - // FIXME: send new config to the daemon. + state.store->setOptions(); } try { 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; |