Nix command/flake archive

From NixOS Wiki
Jump to: navigation, search

This article is about the nix flake archive subcommand.

Description

Copy a flake and all its inputs to a store.

Usage

$ nix flake archive FLAGS... FLAKE-URL?

Flags

  • --arg NAME EXP argument to be passed to Nix functions
  • --argstr NAME STRING string-valued argument to be passed to Nix functions
  • --commit-lock-file commit changes to the lock file
  • --dry-run show what this command would do without doing it
  • --impure allow access to mutable paths and repositories
  • -I, --include PATH add a path to the list of locations used to look up <...> file names
  • --json produce JSON output
  • --no-registries don't use flake registries
  • --no-update-lock-file do not allow any updates to the lock file
  • --no-write-lock-file do not write the newly generated lock file
  • --override-flake ORIGINAL-REF RESOLVED-REF override a flake registry value
  • --override-input INPUT-PATH FLAKE-URL override a specific flake input (e.g. 'dwarffs/nixpkgs')
  • --recreate-lock-file recreate lock file from scratch
  • --to STORE-URI URI of the destination Nix store
  • --update-input INPUT-PATH update a specific flake input

Examples

To copy the dwarffs flake and its dependencies to a binary cache:

$ nix flake archive --to file:///tmp/my-cache dwarffs

To fetch the dwarffs flake and its dependencies to the local Nix store:

$ nix flake archive dwarffs

To print the store paths of the flake sources of NixOps without fetching them:

$ nix flake archive --json --dry-run nixops

See also