NixOS is both a Linux distribution and a package manager that can be installed on other distributions. It bills itself as a “purely functional” distribution with declarative configuration and atomic upgrades/rollbacks.
GNU Guix has similar goals, but (as of 2019) is significantly more annoying to install.
My practical interest involves using the Nix package manager to get fresher versions of some software on Debian Stable.
$ curl https://nixos.org/nix/install | sh
An unprivileged user can install the Nix package manager. So, apart from the risk of piping a script from the internet to a root shell, it’s unnecessary here. However, on Debian 9, this was necessary first:
# sysctl kernel.unprivileged_userns_clone=1
General Nix use:
$ nix-env --help $ nix-env --query --available some-package $ nix-env --install some-package $ nix-env --upgrade some-package $ nix-env --upgrade '*' $ nix-env --rollback $ nix-env --uninstall some-package $ nix-collect-garbage