mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
The ability to substitute inputs was removed in #10612 because it was broken: with user-specified inputs containing a `narHash` attribute, substitution resulted in an input that lacked the attributes returned by the real fetcher (such as `lastModified`). To fix this, we introduce a new input attribute `final`. If `final = true`, fetching the input cannot add or change any attributes. We only attempt to substitute inputs that have `final = true`. This is implied by lock file entries; we only write a lock file if all its entries are "final". The user can specified `final = true` in `fetchTree`, in which case it is their responsibility to ensure that all attributes returned by the fetcher are included in the `fetchTree` call. For example, nix eval --impure --expr 'builtins.fetchTree { type = "github"; owner = "NixOS"; repo = "patchelf"; final = true; narHash = "sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM="; }' succeeds in a store path with the specified NAR hash exists or is substitutable, but fails with error: fetching final input '{"final":true,"narHash":"sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM=","owner":"NixOS","repo":"patchelf","type":"github"}' resulted in different input '{"final":true,"lastModified":1718457448,"narHash":"sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM=","owner":"NixOS","repo":"patchelf","rev":"a0f54334df36770b335c051e540ba40afcbf8378","type":"github"}' |
||
---|---|---|
.. | ||
build-remote | ||
external-api-docs | ||
internal-api-docs | ||
libcmd | ||
libexpr | ||
libexpr-c | ||
libfetchers | ||
libflake | ||
libmain | ||
libmain-c | ||
libstore | ||
libstore-c | ||
libutil | ||
libutil-c | ||
nix | ||
nix-build | ||
nix-channel | ||
nix-collect-garbage | ||
nix-copy-closure | ||
nix-env | ||
nix-instantiate | ||
nix-store | ||
perl | ||
nix-expr-test-support | ||
nix-expr-tests | ||
nix-fetchers-tests | ||
nix-flake-tests | ||
nix-functional-tests | ||
nix-manual | ||
nix-store-test-support | ||
nix-store-tests | ||
nix-util-test-support | ||
nix-util-tests |