git.iko.soy/typeable/nixpkgs
on master help sign in
lib: add shortcuts for fake hashes (fakeSha256, fakeSha512)

Fake hashes can be used as placeholders for all the places, where Nix expression requires a hash, but we don't yet have one. This should be more convenient than following: - echo|sha256sum, copy into clipboard, go to editor, paste into previously edited place - search nixpkgs for a random package, copy it's hash to cliboard, go to editor, paste into previously edited place Nix can add support for these fake hashes. In that case printed error should contain only 1 hash, so no more problem "which of two hashes from error should I use?" Idea by irc:Synthetica

commit68a6b47b8cdbcef4cab3a1f5fae7667a792c27eb authordanbst <abcz2.uprola@gmail.com> dateThu 10 Jan 2019, 15:08 (8 years ago) parent7d864c6
2 files changed+5
lib/default.nix+1 lib/deprecated.nix+4
lib/default.nix+1
@@ -132,6 +132,7 @@ let
132132 mergeAttrsWithFunc mergeAttrsConcatenateValues
133133 mergeAttrsNoOverride mergeAttrByFunc mergeAttrsByFuncDefaults
134134 mergeAttrsByFuncDefaultsClean mergeAttrBy
135+ fakeSha256 fakeSha512
135136 nixType imap;
136137 });
137138in lib
lib/deprecated.nix+4
@@ -270,4 +270,8 @@ rec {
270270 starting at zero.
271271 */
272272 imap = imap1;
273+
274+ # Fake hashes. Can be used as hash placeholders, when computing hash ahead isn't trivial
275+ fakeSha256 = "0000000000000000000000000000000000000000000000000000000000000000";
276+ fakeSha512 = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
273277}