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
- 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)
- 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./anotherinstead ofanother. 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
--argname expr β Pass the value expr as the argument name to Nix functions.--arg-from-filename path β Pass the contents of file path as the argument name to Nix functions.--arg-from-stdinname β Pass the contents of stdin as the argument name to Nix functions.--argstrname 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-storestore-url β The URL of the Nix store to use for evaluation, i.e. to store derivations (.drvfiles) and inputs referenced by them.--impureβ Allow access to mutable paths and repositories. living dangerously, love that for you π--include,-Ipath β 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-flakeoriginal-ref resolved-ref β Override the flake registries, redirecting original-ref to resolved-ref.
π§ Common flake-related options
--commit-lock-fileβ Commit changes to the flake's lock file. git girlies rise π«Ά--inputs-fromflake-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-fileflake-lock-path β Write the given lock file instead offlake.lockwithin the top-level flake.--override-inputinput-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-fileflake-lock-path β Read the given lock file instead offlake.lockwithin the top-level flake.--update-inputinput-path β Update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED Use nix flake update instead.
π Logging-related options
--debugβ Set the logging verbosity level to 'debug'.--log-formatformat β Set the format of log output; one ofraw,internal-json,barorbar-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.--optionname value β Set the Nix configuration setting name to value (overridingnix.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
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms