Updated First Steps With Nix on Debian
Mixing Debian with Nix in 2023 (updated from 2021)
Why Nix?
Mainly because $some_package is not (yet) available in Debian.
installation
to install, do, as root:
apt install nix nix-setup-systemd
to allow the regular system users to use nix, add them to the nix-users group:
adduser $your_user_name_here nix-users
then, as user, you can install nix packages. in this example, i install "typst".
nix shell nixpkgs#typst
errors
if you get errors like:
nix-daemon.socket: failed to open /etc/systemd/system/nix-daemon.socket: no such file or directory
then you have bits and pieces of an earlier nix version lingering around.
And while you're cleaning that, you can also, remove ~/.nix-profile ~/.nix-defexpr .nix-channels files. You can even remove /nix
If you have
nix-daemon.socket: socket service nix-daemon.service already active, refusing.
Then you forgot:
adduser $your_user_name_here nix-users
logout of your X session, and start again, or reboot.