nix3-store-roots-daemon(1)
π nix3-store-roots-daemon(1) π
okay bestie, so this one lives in the General Commands Manual and honestly? it's a whole vibe. it's a manual page for the nix command suite, and before we even get into it:
β οΈ Warning β this program is experimental and its interface is subject to change. no cap. it might get a glow-up without warning you. π
β¨ NAME β¨
nix store roots-daemon β run a daemon that returns garbage collector roots on request π
π SYNOPSIS π
nix store roots-daemon [optionβ¦]
πΈ EXAMPLES πΈ
- run the daemon, that's it, that's the whole job:
# nix store roots-daemon
π DESCRIPTION π
so this command runs a daemon that serves garbage collector roots from a Unix domain socket. it's not required in all Nix installations, but it's genuinely so useful when the main Nix daemon isn't running as root β because then it literally can't find runtime roots by scanning /proc. π
when the garbage collector runs with use-roots-daemon enabled, it connects to this daemon to discover additional roots that should not be collected. protecting the girlies. π«Ά
the daemon listens on <state-dir>/gc-roots-socket/socket β typically /nix/var/nix/gc-roots-socket/socket. iykyk. π
π PROTOCOL π
the protocol is simple, like uncomplicated-relationship simple. for each client-initiated Unix socket connection, the server:
- sends zero or more store paths as NUL-terminated (
\0) strings. - closes the connection.
example (with \0 shown as newlines for clarity):
/nix/store/s66mzxpvicwk07gjbjfw9izjfa797vsw-hello-2.12.1
/nix/store/fvpr7x8l3illdnziggvkhdpf6vikg65w-git-2.44.0
π SECURITY π
okay so, real talk, this part matters. π₯
No information is provided as to which processes are opening which store paths. so yeah. however β while only the main Nix daemon needs to use this daemon, any user able to talk to the main Nix daemon can already obtain the same information with nix-store --gc --print-roots.
therefore, restricting this daemon to only accept the Nix daemon as a client is, while recommended for defense-in-depth reasons, strictly speaking not reducing what information can be extracted β versus merely restricting this daemon to accept connections from any allowed user. the way that changes literally nothing information-wise is wild. π
π§ SYSTEMD SOCKET ACTIVATION π§
nix store roots-daemon supports systemd socket-based activation, just like nix daemon. slay, consistency. β¨
βοΈ OPTIONS βοΈ
π Logging-related options
--debugβ set the logging verbosity level todebug. we're nosy today, and that's valid. π--log-formatformat β set the format of log output; one ofraw,internal-json,barorbar-with-logs.--print-build-logs/-Lβ print full build logs on standard error.--quietβ decrease the logging verbosity level. shhh. π€«--verbose/-vβ increase the logging verbosity level. tell me EVERYTHING. π£οΈ
π Miscellaneous global options
--helpβ show usage information.--offlineβ disable substituters and consider all previously downloaded files up-to-date.--optionname value β set the Nix configuration setting name to value (overridingnix.conf).--refreshβ consider all previously downloaded files out-of-date.--versionβ show version information.
π Note β see man nix.conf for overriding configuration settings with command line flags. go read it, bestie, i believe in you π
and that's the page!! π it was served fresh from nix3-store-roots-daemon(1), General Commands Manual, version and date included, no cap. periodt. π
β¨
π¦ where this page comes from
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms