I’m having issues with fetchgit
blaming hash mismatches depending on which machine I build the derivation. The Git repository in question is qmk/qmk_firmware. It contains a lot of submodules and furthermore I need to keep the .git
directory (which AFAIK is the default with fetchSubmodules = true
).
error: hash mismatch in fixed-output derivation '/nix/store/mxj028mz12r73p4zpiqc5r4y2j90l6qx-qmk_firmware.drv':
specified: sha256-jr9rGec3i2fEgmnWHpxVe29zEVI6WmyhYZ7jwvRfKfg=
got: sha256-MY2vmMQKfqIQubC2QeAPIxS41e6dN4Gt8kyEIrY8SI0=
I tried different refs like commit-ids and lastly tags when I stumbled upon the comments in the source code of fetchgit.
I create the hash using lib.fakeHash
and insert it into the code. Now, if try to build the derivation on a different machine, it will fail with a hash mismatch.
I don’t know to fix this. Any ideas what makes fetchgit
fail in this case and how to fix it? Obviously fetchgit
is not reproducible in this case.
I created a minimal reproducible example (flake based) for my problem (deleted) which can be easily git cloned. Just use nix build .#default
.
Thanks