Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Troubleshooting

Nix not found

command not found: nix or flk commands fail with Nix errors.

  1. Install Nix (see Installation) and check nix --version.
  2. Enable flakes in ~/.config/nix/nix.conf:
    experimental-features = nix-command flakes
    
  3. Open a new shell.

Search or version lookup errors

flk search or flk add --version fails with network or evaluation errors.

Both run nix run github:vic/nix-versions, which needs network access. Try it directly to see the real error:

nix run github:vic/nix-versions -- -p ripgrep

Behind a proxy, check Nix’s proxy settings.

Lock file missing or corrupted

error: getting status of flake.lock: No such file or directory

nix flake lock          # regenerate
flk lock restore latest # or restore a backup

Shell hook not working

switch and refresh don’t exist after activating.

  1. Check the hook is in your rc file (flk hook).
  2. Open a new shell and run flk activate.
  3. type switch should print a function.

direnv not loading the environment

The environment doesn’t load when you enter the directory.

  1. Run flk direnv init, then direnv allow.
  2. Check direnv’s own hook is in your rc file.
  3. Check .envrc contains a use flake line.

Package not found

flk add <package> fails with “package not found”.

The nixpkgs name may differ from the binary name (ripgrep, not rg). Look it up with flk search <term>; flk deep-search <package> lists versions.

Unfree license refusal

Entering the shell fails with “has an unfree license (‘unfree’), refusing to evaluate”.

Allow the package by the name in the error (the quoted slack-4.49.89 means flk unfree add slack), then run refresh. See flk unfree.

Profile errors

“Profile not found” or profile-related errors.

Run flk profile list to see what exists. Profile names may contain only letters, digits, - and _.

Activation fails

flk activate or nix develop fails with evaluation errors.

  1. Look for syntax errors in .flk/profiles/*.nix.
  2. Run nix flake check.
  3. If an input broke, flk lock restore latest; if it’s just old, flk update.

Container export issues

flk export --format docker fails.

Docker or Podman must be installed and running, and you need permission to use it. docker info or podman info should succeed.