Skip to content

flox init command


flox-init - initialize flox expressions for current project.


flox [ <general-options> ] init [ <options> ] # DESCRIPTION

Add a new package using a template.

Given a <template> creates a new package definition in PROJECT_ROOT/<name>.

An existing package called <name> will raise an error.

If <template> or <name> are unspecified and a controlling TTY is present, flox will query them using interactive dialogs.

In non interactive shells the command will fail without a <name> and default to a generic builder for <template>.


General Options

Many flox commands wrap Nix commands of the same name, and will correspondingly pass on options and arguments directly to the underlying nix invocation. For more information on the options supported by specific Nix commands please invoke flox nix <command> help.

The following options are used specifically by flox and must be specified before the <command> argument.

-v, --verbose
Verbose mode. Invoke multiple times for increasing detail.

Debug mode. Invoke multiple times for increasing detail.

-V, --version
Print flox version.

Print flox installation prefix / Nix store path. (flox internal use only.)

Force execution in flox-bash (flox internal use only.)

Init Options

[ --name <name> | -n <name> ]
Name of the package to be created. Queried interactively if controlling TTY is attached

[ --template <template> | -t <template> ]
Template to create new package definition from.