Easily install Nix in a Qubes VM.
Qubes virtual machines are usually based on templates and make it hard to have a persistent Nix installation (surviving restarts). This is hard because Nix assumes the directory /nix as the place to store all nix artefacts. There does not seem to be an easy option to change the default path in Nix.
/nix is defined as a bind-dir in the Qubes VM. The installer then installs Nix in single-user mode.
There is no "uninstall" defined (yet).
- Create a new virtual machine in Qubes
- Download the installation script (it is self-contained)
- Run the installation script
- Run
source ${HOME}/.profileto load the environment - Run
nix --versionto verify that nix is installed
Pull Requests are preferred.
https://www.qubes-os.org/doc/bind-dirs/
https://nixos.org/manual/nix/stable/installation/installation.html