What is Nix?

I recently started using Nix. It is a package manager and a build system. It uses its own functional programming language. At the moment I use it only as a package manager. For years, I maintained Ansible playbook for setting up my development environments. Nix allows to simplify it and eventually might even replace it. Instead of installing software via apt/pipx/downloading binaries from GitHub I use Nix.

Niv sounds interesting but I haven’t tried it out yet.

Installing Nix

There any many ways to install nix. I decided to use nix-installer from DeterminateSystems.

  1. Install nix via nix-installer:
  2. Add /nix/var/nix/profiles/default/bin and ~/.nix-profile/bin to PATH

Install software package

nix profile install nixpkgs#NAME

Remove software package

nix profile list # check number
nix profile remove 42 # number from the list

Clean-up old packages

nix-collect-garbage -d

Upgrade all packages that were installed using an unlocked flake reference

nix profile upgrade '.*'

Some articles about Nix: