daemon: use per-store state directory for socket path #15190
Open
amaanq wants to merge 1 commit intoNixOS:masterfrom
Open
daemon: use per-store state directory for socket path #15190amaanq wants to merge 1 commit intoNixOS:masterfrom
amaanq wants to merge 1 commit intoNixOS:masterfrom
Conversation
5fefd3b to
0e4b44e
Compare
Ericson2314
reviewed
Feb 10, 2026
Ericson2314
requested changes
Feb 10, 2026
Member
Ericson2314
left a comment
There was a problem hiding this comment.
Let's get rid of nixDaemonSocketFile entirely, per the issue. It will force us to recon with everything that is going on.
62fecc6 to
cebafde
Compare
cebafde to
559c051
Compare
f3bba5c to
eb7d3c3
Compare
Ericson2314
reviewed
Mar 9, 2026
855c772 to
e01f00b
Compare
48fe17b to
856dece
Compare
856dece to
06f90b8
Compare
ad3914c to
5a341ee
Compare
899df94 to
d1afb08
Compare
- `nixDaemonSocketFile` and `nixLogDir` are gone. Instead we have `getStateDir` and `getLogDir` functions on `Store::Config`, which are overridden by `LocalFSStore::Config`. This matches the same pattern that was done for `Store::Config::getReadOnly` --- the functions are introduced initially with global settings, and then overridden to take into account store-specific settings for the stores which have those settings. - `getDaemonSocketPath` is a new free-standing function because it does not vary except for with respect to the state dir, which we aleady have `getStateDir` for. It is used to default the socket path for the client (`UdsRemoteStore::Config`) and the server (`nix-daemon` / `nix daemon`). - This commit, beyond being a refactor reducing global variables, does intentionally change behavior. The behavior change is described in eh release note. Fix NixOS#15189
d1afb08 to
e786ac5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This commit makes the daemon socket path derive from the store's
stateDirinstead of the globalnixDaemonSocketFile, sonix daemon --store /foo/barserves from a socket under that store's state directory. The UDS remote store client likewise resolves its default socket path from its ownstateDir.NIX_DAEMON_SOCKET_PATHstill takes priority everywhere.Context
This addresses #15189.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.