LinuxCommandLibrary

flox

Create reproducible development environments

TLDR

Create a new environment in the current directory

$ flox init
copy

Enter an environment, or create one if it doesn't exist
$ flox activate
copy

Search for packages in the FloxHub catalog
$ flox search [package]
copy

Install a package into the current environment
$ flox [[i|install]] [package]
copy

Uninstall a package from the current environment
$ flox uninstall [package]
copy

View a list of all packages installed in the current environment
$ flox [[l|list]]
copy

Push a local environment to FloxHub to share with others
$ flox push
copy

Pull a shared environment from FloxHub
$ flox pull [environment_name]
copy

SYNOPSIS

flox [global-options] <command> [<args>]

Common commands: activate, clone, deploy, diff, doctor, edit, env, flake, generate, ignore, init, install, layer, list, logout, pin, pull, push, remove, search, show

PARAMETERS

-C, --config <FILE>
    Sets a custom config file

--help
    Print help information

--json
    Output JSON instead of human-readable text

--log-level <LEVEL>
    Sets log level: off, error, warn, info, debug, trace

--offline
    Work without network access

--share
    Share with everyone (public access)

--verbose, -v
    More output (equivalent to --log-level debug)

--version
    Print version information

DESCRIPTION

Flox is a fast, intuitive command-line tool for managing software packages and environments on Linux and macOS.

Powered by Nix, it enables users to search, install, and run applications in isolated, reproducible environments without root privileges. Flox simplifies Nix's complexity with ergonomic commands, supporting multiple channels like nixpkgs and community flakes.

Key features include:
• Instant package search and installation (flox install).
• Environment activation for shell sessions.
• Pinning specific package versions for reproducibility.
• Sharing environments via Git with lockfiles.
• Layered environments for project-specific setups.

Flox automatically handles Nix installation and bootstrapping, making it accessible for developers seeking declarative, conflict-free package management. Ideal for polyglot workflows, it excels in CI/CD, local dev, and team collaboration.

CAVEATS

Flox requires a compatible Nix installation (auto-provisioned on first run). Network access needed for initial setup and updates unless --offline used. Subcommands have additional options; use flox <command> --help for details.

EXAMPLE USAGE

flox search htop
flox install htop
flox activate (activates env in current shell)

ENVIRONMENTS

Flox uses ~/.local/share/flox/environments by default. Create project-specific envs with flox init or flox env new.

HISTORY

Developed by Flox Ltd., first released in 2023 as a user-friendly frontend to Nix. Evolved from Project Flox (2022 prototype) to address Nix's steep learning curve, focusing on speed (flox install is 10x faster than nix-env) and developer UX. Actively maintained with regular updates via GitHub.

SEE ALSO

Copied to clipboard