Install Nix

  1. Install Nix (Single-user installation)

    sh <(curl -L https://nixos.org/nix/install) --no-daemon
    
  2. Enable flakes

  3. 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.

  1. Install direnv - src

    1. Install the binary

      nix profile install nixpkgs#direnv
      
    2. Hook into your devshell

  2. Allow direnv to work in a directory.

    direnv allow
    

    When you see direnv errors, run the suggested commands.

Further reading

See Nix prerequisites.