Pinning dependencies
Fixing a Nix dependency to a specific revision
We recommend starting with the Nix quick start and consulting concept docs primarily for clarification. Feel free to click x to the right to disable this notification on all concept docs.
Pinning a dependency refers to the act of specifying an exact revision for Nix to use. This is particularly interesting in relation to Nix’s reproducibility guarantees.
When you pin Nix dependencies to a specific revision you are guaranteed to get the same outputs of builds, based on the same inputs, which cannot change. This is particularly useful when sharing environments between different developers, or between a development and production environment.
Pinning dependencies can be done in the inputs
section of the flakes file: