[Nix-dev] Checksum of an attrset?

Marc Weber marco-oweber at gmx.de
Thu Jul 19 16:48:01 CEST 2012


Try checksumming

rec {
  a = b;
  b = a;
};

and you'll understand that it is not easy to do so (even less since the
aterm library implementation was dropped).

So think about what makes your attr sets distinct and use that for
creating a unique name.

So it may pay off providing more details.

Adding a md5sum primop function to the nix language should be straight
forward.

An alternative solution would be using natural numbers:

let attrs = [a,b,c]
then turn the list into the attr set with unique names - using the list
index as name and the like (check that everything get restarted
correctly)

Marc Weber


More information about the nix-dev mailing list