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 profile

A profile is one .flk/profiles/<name>.nix file with its own packages, commands and environment variables.

flk profile add backend --template rust
flk profile list
flk profile set-default backend
flk profile remove backend

add

flk profile add <NAME> [-t <TEMPLATE>] [-f]

Creates .flk/profiles/<NAME>.nix from a template (base, rust, python, node, go, generic; default base). Names may contain letters, digits, - and _. Fails if the profile exists, unless --force is given.

remove

Deletes the profile file and its cached environment (.flk/.nix-profile-<NAME>*). The default profile can’t be removed; change the default first.

list

Lists the .nix files in .flk/profiles/, sorted, without default.nix.

set-default

Sets defaultProfile in .flk/config.nix (defaultShell in .flk/default.nix on the legacy layout). The profile must exist.

Which profile a command uses

Commands that take -p, --profile pick the profile in this order:

  1. --profile
  2. FLK_FLAKE_REF, which flk activate, refresh and switch set inside the shell
  3. defaultProfile in .flk/config.nix
  4. defaultShell in .flk/default.nix (legacy layout)
  5. the first file in .flk/profiles/

Example

flk init --template generic
flk profile add backend --template rust
flk profile add frontend --template node
flk add cargo-watch --profile backend
flk add nodejs_20 --profile frontend
flk profile set-default backend
flk add ripgrep      # goes to backend

See also flk activate, switch.