Install Nix
-
Install Nix (Single-user installation)
sh <(curl -L https://nixos.org/nix/install) --no-daemon
-
Enable flakes
-
Set
show-trace = true
(doc) to see more complete error messages.
Community
Nix messages
Sometimes, when you enter a devshell (e.g., nix develop
) or run a default package of a flake, you may see:
- warnings - not a problem, just read them and google if you're interested;
- errors - the same story;
- prompts - answer
y
(the simplest way).
direnv
This is a tool for running scripts when you cd
to a directory containing a .envrc
file.
direnv
automatically builds, caches, and starts a devshell when you enter a flake directory containing the .envrc
file (e.g., the root directory of this repository).
See Direnv integration.
-
Install
direnv
- src-
Install the binary
nix profile install nixpkgs#direnv
-
Hook into your devshell
-
-
Allow
direnv
to work in a directory.direnv allow
When you see
direnv
errors, run the suggested commands.
Further reading
See Nix prerequisites.