Nix command/registry pin

From NixOS Wiki
Jump to: navigation, search

This article is about the nix registry pin subcommand.

Description

Pin a flake to its current version in user flake registry.

Usage

$ nix registry pin FLAGS... URL?

Flags

  • --arg NAME EXPR argument to be passed to Nix functions
  • --argstr NAME STRING string-valued argument to be passed to Nix functions
  • --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
  • --override-flake ORIGINAL-REF RESOLVED-REF override a flake registry value

Examples

Pin the version of a nix flake in the system-wide or global registry in the user-registry /$HOME/.config/nix/registry.json

$ nix registry list
global flake:blender-bin github:edolstra/nix-warez

global flake:nix github:NixOS/nix

$ nix registry pin nix
$ nix registry list
user   flake:nix github:NixOS/nix/ed52cf632bf9db90311014600ca0f042ef57ca20
global flake:blender-bin github:edolstra/nix-warez

global flake:nix github:NixOS/nix

The pin can be removed again with nix registry remove nix

$ nix registry remove nix
$ nix registry list
global flake:blender-bin github:edolstra/nix-warez

global flake:nix github:NixOS/nix

See also