nix3-flake
manages Nix flakes
TLDR
SYNOPSIS
nix flake subcommand [options]
DESCRIPTION
nix3-flake is the manual page for nix flake, the command for creating, modifying and querying flakes. A flake is a source tree (usually a Git repository) with a flake.nix at its root declaring its inputs (dependencies) and outputs (packages, dev shells, NixOS configurations and so on). Input versions are pinned in flake.lock.Flakes are referenced with flakerefs such as nixpkgs, github:NixOS/nixpkgs/nixos-unstable, git+https://example.org/repo or a path like .; an output is selected with #, e.g. .#default.
PARAMETERS
show [flake]
Show the outputs provided by a flake. --all-systems includes every system, --json gives machine-readable output.update [inputs...]
Update the lock file, all inputs by default. --flake url selects another flake than the current directory.lock
Create missing lock file entries without updating existing ones.init, new dir
Create a flake in the current (or given) directory from a template (-t).check
Check whether the flake evaluates and run its tests. --all-systems checks every system.metadata, info
Show flake metadata such as the locked revision and input tree.archive
Copy a flake and all its inputs to a store.clone
Clone a flake's repository.prefetch, prefetch-inputs
Download a flake source tree, or the inputs of a flake, into the Nix store.--help
Display help information.
INSTALL
CAVEATS
There is no nix3 executable: the new-CLI man pages are named nix3-subcommand (man nix3-flake, man nix3-flake-update). Run the commands as nix flake.Requires the nix-command and flakes experimental features. In a Git repository only files tracked by Git are visible to the flake, so git add new files first. nix flake update used to update the flake given as argument; it now takes input names and uses --flake to select the flake.
HISTORY
Flakes and nix flake were introduced as an experimental feature in Nix 2.4 (2021). nix flake info is an older alias of nix flake metadata. Nix 2.19 (2023) changed nix flake update to accept input names, replacing nix flake lock --update-input.
SEE ALSO
nix(1), nix-flake(1), nix3-build(1), nix-flake-show(1), nix-flake-init(1), nix-registry(1)
