nix3-flake-update(1)
π nix3-flake-update(1) π
okay bestie, welcome to the General Commands Manual page for nix3-flake-update(1) β aka the lil corner of Unix that teaches you how to refresh your flake lock file. sit down, grab a boba, we're doing this π§β¨
Warning π¨ bestie this program is experimental and its interface is subject to change. like, the vibes are immaculate but the API is in its flop era sometimes. proceed with that in mind, no cap.
β¨ Name β¨
nix flake update β update flake lock file π
π¦ Synopsis π¦
nix flake update [optionβ¦] inputsβ¦
πΈ Examples πΈ
- Update all inputs (i.e. recreate the lock file from scratch) β the full glow-up, every input gets a makeover:
# nix flake update
warning: updating lock file '/home/myself/repos/testflake/flake.lock':
β’ Updated input 'nix':
'github:NixOS/nix/9fab14adbc3810d5cc1f88672fde1eee4358405c' (2023-06-28)
β 'github:NixOS/nix/8927cba62f5afb33b01016d5c4f7f8b7d0adde3c' (2023-07-11)
β’ Updated input 'nixpkgs':
'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' (2023-06-30)
β 'github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293' (2023-07-05)
- Update only a single input β sometimes you just want one of them to change, and that's so valid:
# nix flake update nixpkgs
warning: updating lock file '/home/myself/repos/testflake/flake.lock':
β’ Updated input 'nixpkgs':
'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' (2023-06-30)
β 'github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293' (2023-07-05)
- Update multiple inputs β a lil squad update, they're all getting their hair done together:
# nix flake update nixpkgs nixpkgs-unstable
warning: updating lock file '/home/myself/repos/testflake/flake.lock':
β’ Updated input 'nixpkgs':
'github:nixos/nixpkgs/8f7492cce28977fbf8bd12c72af08b1f6c7c3e49' (2024-09-14)
β 'github:nixos/nixpkgs/086b448a5d54fd117f4dc2dee55c9f0ff461bdc1' (2024-09-16)
β’ Updated input 'nixpkgs-unstable':
'github:nixos/nixpkgs/345c263f2f53a3710abe117f28a5cb86d0ba4059' (2024-09-13)
β 'github:nixos/nixpkgs/99dc8785f6a0adac95f5e2ab05cc2e1bf666d172' (2024-09-16)
- Update only a single input of a flake in a different directory β main character energy: you're operating on a flake that isn't even in your current folder π :
# nix flake update nixpkgs --flake ~/repos/another
warning: updating lock file '/home/myself/repos/another/flake.lock':
β’ Updated input 'nixpkgs':
'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' (2023-06-30)
β 'github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293' (2023-07-05)
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. like β the./is the difference between "this specific folder right here" and "um, idk, search the registry bestie". don't skip it, it's giving necessary.
π Description π
This command updates the inputs in a lock file (flake.lock). By default, all inputs are updated. If the lock file doesn't exist yet, it will be created. If inputs are not in the lock file yet, they will be added. so generous of it fr fr π«Ά
Unlike other nix flake commands, nix flake update takes a list of names of inputs to update as its positional arguments and operates on the flake in the current directory. You can pass a different flake-url with --flake to override that default.
The related command nix flake lock also creates lock files and adds missing inputs, but is safer as it will never update inputs already in the lock file. so if you're feeling β¨delicateβ¨ about your existing pins, that's the one. nix flake update is the one that actually yanks things forward.
π₯ Options π₯
--flakeflake-url β The flake to operate on. Default is the current directory. π
β 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 like a lil sit-down with your code when things go sideways π«--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. (yes it's the chaotic option, embrace it)--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. so -I is the loud friend who talks over everyone else, respectfully.
--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. π the old one is so over.
--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. β οΈ yes bestie, it implies it, that's not a typo.--recreate-lock-fileβ Recreate the flake's lock file from scratch.
DEPRECATED Use nix flake update instead. girl the whole point of this page is doing it the new way π
--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. same energy, better command, keep up π«Ά
π Logging-related options π
--debugβ Set the logging verbosity level to 'debug'. maximum yapping mode about what's happening π--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.
π 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. π οΈ the fix-it option, we love her.--versionβ Show version information.
Note See man nix.conf for overriding configuration settings with command line flags. iykyk β the config lore lives over there π
and that's the whole page, bestie π you now officially understand nix flake update better than 90% of people who run it every day. slay. π
β¨
this was nix3-flake-update(1) from the General Commands Manual β go forth, update your inputs, and remember: the interface is experimental, so be nice to it. bye babe, drink water π¦π
π¦ 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