fix building images when non-binary reproducible builds are present

closure-info has one flaw, it's possible that this file contains stale
information when build are not reproducible and the local checksum
doesn't match what the remote build created.
The work-around here is that we disregard the hashes and re-compute with
what nar's we actually have locally instead.
This commit is contained in:
Jörg Thalheim committed 2024-05-06 19:29:20 +02:00
1 parent e5b3299a14
commit 4f8c8580b4
2 files changed
+48 -1

No files matched your search

+3 -1
View File
@@ -38,6 +38,8 @@ let
${lib.concatMapStringsSep "\n" (disk: "mv ${disk.name}.raw \"$out\"/${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)}
${extraPostVM}
'';
closureInfo = pkgs.callPackage ./closure-info.nix { };
partitioner = ''
# running udev, stolen from stage-1.sh
echo "running udev..."
@@ -55,7 +57,7 @@ let
# populate nix db, so nixos-install doesn't complain
export NIX_STATE_DIR=$TMPDIR/state
nix-store --load-db < ${pkgs.closureInfo {
${pkgs.fakeroot}/bin/fakeroot nix-store --register-validity --reregister < ${closureInfo {
rootPaths = [ systemToInstall.config.system.build.toplevel ];
}}/registration