Comment 5 for bug 2064563

Revision history for this message
Peter Valdemar Mørch (pmorch) wrote :

In addition, nix environment variables don't get set up when one logs in via ssh.

 I As the OP points out:

> nix-setup-systemd also ends up setting up the NIX_PATH to per-user dir above making the assumption that it was completed in this file:
> - `/usr/lib/environment.d/nix-daemon.conf`

It also sets up NIX_REMOTE and modifies PATH.

The problem is that /usr/lib/environment.d/nix-daemon.conf is sourced by systemd-environment-d-generator(8) that parses them and updates the environment exported by the systemd user instance (see https://www.freedesktop.org/software/systemd/man/latest/environment.d.html). Which means the environment variables are set for processes started by the systemd user instance (only).

And not when you login via ssh.

Because of this, nix works (except for the problems presented previously in this bug) only for the desktop session, and not when logged in via ssh.