Nix Installation Guide: Difference between revisions

Klinger (talk | contribs)
Add "Installing on Debian Using APT" section
Line 172: Line 172:
You can make all nix commands use the alternate store by specifying it in `~/.config/nix/nix.conf` as <code>store = /home/USERNAME/my-nix</code>.
You can make all nix commands use the alternate store by specifying it in `~/.config/nix/nix.conf` as <code>store = /home/USERNAME/my-nix</code>.


== Installing on Debian Using APT ==
If you are using Debian (or a Debian-based distro) you can install Nix with the APT package manager. Some users may prefer using APT when modifying their system. The package named <code>nix-setup-systemd</code> will set up a multi-user Nix installation and run <code>nix-daemon</code> via <code>systemd</code>
<syntaxHighlight lang="console">
$ sudo apt install nix-setup-systemd
</syntaxHighlight>
After installing, you should read <code>/usr/share/doc/nix-bin/README.Debian</code>. In particular, you will need to add your user to the <code>nix-users</code> group in order to use the daemon:
<syntaxHighlight lang="console">
$ sudo /sbin/adduser $USER nix-users
</syntaxHighlight>
Note that in Debian [https://packages.debian.org/bookworm/nix-setup-systemd Bookworm] <code>/etc/nix/nix.conf</code> will contain <code>sandbox = false</code>, but in Debian https://packages.debian.org/trixie/nix-setup-systemd Trixie], sandbox mode is enabled by default. (See the Changelog for details.)


== Windows Subsystem for Linux (WSL) ==
== Windows Subsystem for Linux (WSL) ==