Skip to main content
fh

One CLI for everything FlakeHub

fh is the official CLI companion for FlakeHub. Search the registry, add and pin flake inputs to SemVer ranges, scaffold a new flake.nix, deploy your NixOS, Home Manager, and nix-darwin configs, and fetch outputs directly from FlakeHub Cache, no local evaluation required. It's written in Rust and works with the identity your team already uses.

fh apply docs: Deploy with fh apply

Deploy with fh apply

Apply a NixOS, Home Manager, or nix-darwin configuration straight from FlakeHub with one command. fh apply fetches the pre-built closure and activates it, with no flake to clone and no expression to evaluate.
fh apply docs (opens in a new tab)
SemVer in FlakeHub: Add and pin flake inputs

Add and pin flake inputs

fh add adds a flake input to your flake.nix pinned to a SemVer range, so nix flake update tracks the versions you allow instead of a moving branch.
SemVer in FlakeHub (opens in a new tab)
fh init docs: Scaffold a new flake

Scaffold a new flake

fh init generates a flake.nix for you, combining what's already in your project with a few prompts, so a new project is flake-ready in seconds.
fh init docs (opens in a new tab)

Search and browse FlakeHub

fh search and fh list find flakes, organizations, releases, and versions on FlakeHub from the terminal, so you can discover inputs without leaving your shell.
FlakeHub Cache: Fetch straight from FlakeHub Cache

Fetch straight from FlakeHub Cache

fh fetch and fh resolve pull flake outputs and their store paths directly from FlakeHub Cache, so constrained machines get artifacts without paying the local evaluation tax.
FlakeHub Cache (opens in a new tab)
Federated authentication: Federated login, no static credentials

Federated login, no static credentials

fh login authenticates against the identity your team already runs, issuing short-lived tokens instead of long-lived secrets to manage.
Federated authentication
DeterminateSystems/fh: Written in Rust

Written in Rust

fh is built in Rust for a fast, single-binary install with no runtime to manage. It uses Determinate Nix's C API directly for minimal overhead.
DeterminateSystems/fh (opens in a new tab)
  • FlakeHub CLI documentation

    FlakeHub CLI documentation (opens in a new tab)

    The full fh reference: every subcommand, from apply and add to search, convert, and resolve.

  • Nix-based deployments

    Nix-based deployments

    How fh apply and FlakeHub Cache deploy Nix configs without building or evaluating on the target.

  • Supercharging Nix deployments with FlakeHub Cache

    Supercharging Nix deployments with FlakeHub Cache

    A walkthrough of deploying a Home Manager config on macOS and Linux with fh apply, bypassing local builds and evaluation.

  • fh on GitHub

    fh on GitHub (opens in a new tab)

    The fh repository, with the latest releases, installation instructions, and issue tracker.

Explore more tools