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:
--profileFLK_FLAKE_REF, whichflk activate,refreshandswitchset inside the shelldefaultProfilein.flk/config.nixdefaultShellin.flk/default.nix(legacy layout)- 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.