Big refactor to re-organize things. packagesFromDirectoryRecursive is amazing.
No long need to pass individual derivations around but can use the recursive scopes.
Removes a lot of repetition.
Found out that typst and typix do not produce deterministic PDF files.
Clearspace imagery is almost done.
@avocadoom can we start using the new logos on the website now?
@djacu give me one more week to make a better media kit
Sure. To preface, they are effectively the same but not byte-for-byte equal. What tipped me off was seeing this message when trying to use --rebuild.
error: derivation ‘/nix/store/hfw047mh689zmhkfxqzlql7aa0cfcijk-nixos-branding-guide-0.1.0.drv’ may not be deterministic: output ‘/nix/store/32l2sg2dgls390s1ab2w739vigr9vyhj-nixos-branding-guide-0.1.0’ differs
So I reran the build with --keep-failed and compared the default output with the .check output like so.
I used qpdf to remove the metadata, linearize the PDF, and create a new deterministic trailer ID. That almost fixed it but the trailer ID was still different. The trailer ID has two IDs. The first is created upon PDF generation and never changes. The second is initially the same as the first but updates when the PDF changes. So after my fixes, the second ID matched but the first ID was still different. I then used cpdf to initially remove the trailer ID before passing it to qpdf to perform the same aforementioned fixes and then it was deterministic.
As I’ve shown in the post above, it is not an issue with the date. I had already added the following line to the top of my typst file to prevent the creation date being included in the output PDF.
#set document(date: none)
The problem is with how graphical attributes are added to the PDF. They should and could very easily be linearized but for some reason were not.
I even tried reducing the main.typ file down to just this:
// Date must be set to none for deterministic builds
#set document(date: none)
#set page("a4", flipped: true)
#image("./nixos-lambda-dimensioned-linear.svg")
I’ve been told that this issue might have been fixed upstream, I will see if I can test this during the weekend. Tip: they have a flake in their repo if you feel like testing it by yourself in the meantime.
This has certainly been fixed upstream! It even fixes some new inconsistencies I found when adding new SVG files. Thanks for investigating this @drupol. I’ll be happy to upgrade once they cut a new release.