diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index b8411f5e5ec..e279803f2ea 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -27,6 +27,10 @@ , name ? "nixos-disk-image" + # This prevents errors while checking nix-store validity, see + # https://github.com/NixOS/nix/issues/1134 +, fixValidity ? true + , format ? "raw" }: @@ -68,9 +72,11 @@ pkgs.vmTools.runInLinuxVM ( printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \ ${config.nix.package.out}/bin/nix-store --load-db --option build-users-group "" - # Add missing size/hash fields to the database. FIXME: - # exportReferencesGraph should provide these directly. - ${config.nix.package.out}/bin/nix-store --verify --check-contents --option build-users-group "" + ${if fixValidity then '' + # Add missing size/hash fields to the database. FIXME: + # exportReferencesGraph should provide these directly. + ${config.nix.package.out}/bin/nix-store --verify --check-contents --option build-users-group "" + '' else ""} # In case the bootloader tries to write to /dev/sda… ln -s vda /dev/xvda