nix3-flake-lock(1)

πŸ’… nix3-flake-lock β€” General Commands Manual ✨

Warning bestie. listen. this program is experimental and its interface is subject to change. so like, don't build your whole personality on it. πŸ’€

πŸŽ€ Name

nix flake lock β€” create missing lock file entries 🫢


πŸ¦‹ Synopsis

nix flake lock [option…] flake-url

🌸 Examples

  1. Create the lock file for the flake in the current directory:
# nix flake lock
warning: creating lock file '/home/myself/repos/testflake/flake.lock':
β€’ Added input 'nix':
  'github:NixOS/nix/9fab14adbc3810d5cc1f88672fde1eee4358405c' (2023-06-28)
β€’ Added input 'nixpkgs':
  'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' (2023-06-30)
  1. Add missing inputs to the lock file for a flake in a different directory:
# nix flake lock ~/repos/another
warning: updating lock file '/home/myself/repos/another/flake.lock':
β€’ Added input 'nixpkgs':
  'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' (2023-06-30)
Note When trying to refer to a flake in a subdirectory, write ./another instead of another. Otherwise Nix will try to look up the flake in the registry. no cap, this one trips everybody up fr fr 😭

πŸ’– Description

This command updates the lock file of a flake (flake.lock) so that it contains an up-to-date lock for every flake input specified in flake.nix. Lock file entries that are already up-to-date are not modified. periodt. πŸ‘‘

If you want to update existing lock entries, use nix flake update ✨


πŸ‘‘ Options

🌈 Common evaluation options

  • --arg name expr β€” Pass the value expr as the argument name to Nix functions.
  • --arg-from-file name path β€” Pass the contents of file path as the argument name to Nix functions.
  • --arg-from-stdin name β€” Pass the contents of stdin as the argument name to Nix functions.
  • --argstr name string β€” Pass the string string as the argument name to Nix functions.
  • --debugger β€” Start an interactive environment if evaluation fails. it's giving "let me poke around" πŸ”
  • --eval-store store-url β€” The URL of the Nix store to use for evaluation, i.e. to store derivations (.drv files) and inputs referenced by them.
  • --impure β€” Allow access to mutable paths and repositories. living dangerously, love that for you πŸ™ˆ
  • --include, -I path β€” Add path to search path entries used to resolve lookup paths.

This option may be given multiple times.

Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable. πŸ’…

  • --override-flake original-ref resolved-ref β€” Override the flake registries, redirecting original-ref to resolved-ref.
  • --commit-lock-file β€” Commit changes to the flake's lock file. git girlies rise 🫢
  • --inputs-from flake-url β€” Use the inputs of the specified flake as registry entries.
  • --no-registries β€” Don't allow lookups in the flake registries.
DEPRECATED Use --no-use-registries instead. she's retired, respect her legacy πŸ’€
  • --no-update-lock-file β€” Do not allow any updates to the flake's lock file.
  • --output-lock-file flake-lock-path β€” Write the given lock file instead of flake.lock within the top-level flake.
  • --override-input input-path flake-url β€” Override a specific flake input (e.g. dwarffs/nixpkgs). The input path must not be empty. This implies --no-write-lock-file.
  • --recreate-lock-file β€” Recreate the flake's lock file from scratch.
DEPRECATED Use nix flake update instead.
  • --reference-lock-file flake-lock-path β€” Read the given lock file instead of flake.lock within the top-level flake.
  • --update-input input-path β€” Update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED Use nix flake update instead.
  • --debug β€” Set the logging verbosity level to 'debug'.
  • --log-format format β€” Set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs, -L β€” Print full build logs on standard error.
  • --quiet β€” Decrease the logging verbosity level. shhh 🀫
  • --verbose, -v β€” Increase the logging verbosity level. tell me EVERYTHING 😭

⭐ Miscellaneous global options

  • --help β€” Show usage information.
  • --offline β€” Disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” Set the Nix configuration setting name to value (overriding nix.conf).
  • --refresh β€” Consider all previously downloaded files out-of-date.
  • --repair β€” During evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths.
  • --version β€” Show version information.
Note See man nix.conf for overriding configuration settings with command line flags. iykyk πŸ’œ

and that's the whole page bestie!! πŸ¦‹βœ¨ this lil icon lives in the General Commands Manual as nix3-flake-lock(1) β€” go forth and lock those flakes, you absolute main character πŸ’…πŸ‘‘πŸ’–

πŸ“¦ where this page comes from