Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explanation of how output hashes are derived #9189

Open
roberth opened this issue Oct 19, 2023 · 1 comment
Open

Explanation of how output hashes are derived #9189

roberth opened this issue Oct 19, 2023 · 1 comment

Comments

@roberth
Copy link
Member

roberth commented Oct 19, 2023

          > What kind of changes to the lowlevel implementations in nixpkgs could change the hash of a static text file

None. The contents of the output of writeTextFile is very very stable, which is why you want a content-addressed output instead of an input addressed output. By making it a fixed-output derivation that's exactly what you get. It shields you from the many obscure changes that happen to the derivation closure.

How output path hashes are derived would be a good topic for an explanation, but what we have now is reference docs, https://nixos.org/manual/nix/stable/language/advanced-attributes.html?highlight=outputHash#adv-attr-outputHash

Originally posted by @roberth in NixOS/nixpkgs#246115 (comment)

@roberth
Copy link
Member Author

roberth commented Oct 19, 2023

ie more prosaic explanation of how hashing works instead of having to click through a ton of reference docs to piece it together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant