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

flk activate

Enters the dev shell.

flk activate
flk activate --profile backend

Options

  • -p, --profile <PROFILE>: profile to activate instead of the default

Behavior

  • Runs nix develop .#<profile> --impure
  • Reuses a cached develop profile from .flk/.nix-profile-<profile> when your flake config is unchanged
  • Refreshes that cached profile when flake.nix, flake.lock, or the relevant .flk profile files change
  • Picks the profile as described in profile selection
  • Exports FLK_FLAKE_REF and FLK_PROFILE so refresh/switch know the active profile (flk global activate also exports FLK_ENV_DIR)
  • Exports FLK_ORIG_PATH, the PATH before activation, which refresh/switch reset to

Shell selection

The shell started inside the environment is, in order:

  1. FLK_SHELL
  2. $SHELL, unless it points into /nix/store. nix develop and nix-shell set SHELL to nixpkgs’ non-interactive bash, which has no completion and a broken prompt.
  3. The login shell from /etc/passwd
  4. /bin/sh

refresh and switch use the same order.

See also flk hook for refresh/switch, and flk direnv to activate on cd.