nix3-daemon(1)

πŸ’… nix3-daemon(1) β€” General Commands Manual πŸŽ€

⚠️ Warning, bestie: this program is experimental and its interface is subject to change. Like, it might just switch up on you. No cap.

✨ Name ✨

nix daemon β€” the daemon that does store operations on behalf of non-root clients 🫢


🌸 Synopsis 🌸

nix daemon [option…]

πŸ¦‹ Examples πŸ¦‹

  • Run the daemon, just like that:
# nix daemon
  • Run the daemon and listen on standard I/O instead of binding to a UNIX socket:
# nix daemon --stdio
  • Run the daemon and force all connections to be trusted:
# nix daemon --force-trusted
  • Run the daemon and force all connections to be untrusted:
# nix daemon --force-untrusted
  • Run the daemon, listen on standard I/O, and force all connections to use Nix's default trust:
# nix daemon --stdio --default-trust

πŸ’– Description πŸ’–

Okay so this command runs the Nix daemon, and it's a required component in multi-user Nix installations. It's out here running build tasks and other operations on the Nix store on behalf of non-root users. Slay. Usually you don't run the daemon directly β€” instead it's managed by a service management framework like systemd on Linux, or launchctl on Darwin. Let the framework handle it, it's got main character energy.

πŸ“Œ Note that this daemon does not fork into the background. It stays right there. It's not leaving. Periodt.

πŸ”Œ Socket path πŸ”Œ

Unless --stdio is used, the daemon listens on a Unix domain socket. The socket path is figured out similarly as for the Local Daemon Store, in this exact order:

  1. The --socket-path flag, if passed.
  2. The NIX_DAEMON_SOCKET_PATH environment variable, if set.
  3. Otherwise, daemon-socket/socket within the store's state directory. The Local Store, Local Daemon Store, and Experimental SSH Store with filesystem mounted each have their own per-store state directory. For other store types, the global NIX_STATE_DIR is used.

⚑ Systemd socket activation ⚑

nix daemon supports systemd socket-based activation using the nix-daemon.socket unit in the Nix distribution. It supports listening on multiple addresses β€” iconic behaviour honestly. For example, the following stanza in nix-daemon.socket makes the daemon listen on two Unix domain sockets:

[Socket]
ListenStream=/nix/var/nix/daemon-socket/socket
ListenStream=/nix/var/nix/daemon-socket/socket-2

✨ Options ✨

  • --default-trust β€” Use Nix's default trust.
  • --force-trusted β€” Force the daemon to trust connecting clients.
  • --force-untrusted β€” Force the daemon to not trust connecting clients. The connection is processed by the receiving daemon before forwarding commands.
  • --process-ops β€” Forces the daemon to process received commands itself rather than forwarding the commands straight to the remote store.
This is useful for the mounted-ssh:// store where some actions need to be performed on the remote end but as connected user, and not as the user of the underlying daemon on the remote end.
  • --socket-path path β€” Path to the daemon's UNIX socket. Overrides NIX_DAEMON_SOCKET_PATH and the default. Incompatible with --stdio. 🚫
  • --stdio β€” Attach to standard I/O, instead of using UNIX socket(s).
  • --debug β€” Set the logging verbosity level to 'debug'.
  • --log-format format β€” Set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs / -L β€” Print full build logs on standard error.
  • --quiet β€” Decrease the logging verbosity level.
  • --verbose / -v β€” Increase the logging verbosity level.

🌈 Miscellaneous global options 🌈

  • --help β€” Show usage information.
  • --offline β€” Disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” Set the Nix configuration setting name to value (overriding nix.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.

And that's the whole page, bestie β€” this one's from the nix3-daemon(1) manual, like, the General Commands Manual, you know the vibe πŸ‘‘ Hope it ate. Study it, love it, run it responsibly. Bye bestie πŸ’œβœ¨πŸ’…

πŸ“¦ where this page comes from