nix3-daemon - Man Page

daemon to perform store operations on behalf of non-root clients

Warning
This program is experimental and its interface is subject to change.

Synopsis

nix daemon [option…]

Examples

# nix daemon
# nix daemon --stdio
# nix daemon --force-trusted
# nix daemon --force-untrusted
# nix daemon --stdio --default-trust

Description

This command runs the Nix daemon, which is a required component in multi-user Nix installations. It runs build tasks and other operations on the Nix store on behalf of non-root users. Usually you don’t run the daemon directly; instead it’s managed by a service management framework such as systemd on Linux, or launchctl on Darwin.

Note that this daemon does not fork into the background.

Socket path

Unless --stdio is used, the daemon listens on a Unix domain socket. The socket path is determined similarly as for the Local Daemon Store:

  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; 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

      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.

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.