Nix tips and tricks for eRI
Nix is a powerful and end-user-empowering software deployment tool and package manager, now available on eRI. It is an alternative to Conda.
Nix Flakes
Nix Flakes provide a reproduceable mechanism for capturing project dependencies. They are an alternative to Conda environments.
Nis Flakes are to be preferred over Nix channels, for reasons of reproducibility. That is, prefer to use nix develop
with a flake, rather than nix-shell
. The flake.lock
file locks to a specific git commit exactly which dependencies have been installed.
Nix Home Manager
Nix Home Manager is a tool for a user to manage their own environment (dotfiles, applications, environment) outside of any per-project environment.
Tips
The first time you activate your Home Manager environment (e.g.
home-manager switch -v --flake path:$HOME/vc/env/home.nix#agr-eri
), you may get an errorCould not find suitable profile directory
, which seems to be a first-use problem that can be fixed by runningnix profile list
and retrying thehome-manager switch
command.