Skip to content

Commit 22cd4b7

Browse files
committedDec 5, 2024
check for db.sqlite rather than /nix/store
since we initialize the database last, it's safe to use the database as a sentinel path
1 parent 98894c8 commit 22cd4b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎disko-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ main() {
253253
# nix copy uses up a lot of memory and we work around issues with incorrect checksums in our store
254254
# that can be caused by using closureInfo in combination with multiple builders and non-deterministic builds.
255255
# Therefore if we have a blank store, we copy the store paths and registration from the closureInfo.
256-
if [[ ! -d "${mountPoint}/nix/store" ]]; then
256+
if [[ ! -f "${mountPoint}/nix/var/nix/db/db.sqlite" ]]; then
257257
echo "Copying store paths" >&2
258258
mkdir -p "${mountPoint}/nix/store"
259259
xargs cp --recursive --target "${mountPoint}/nix/store" < "${closure_info}/store-paths"

‎lib/make-disk-image.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ let
9393
9494
# We copy files with cp because `nix copy` seems to have a large memory leak
9595
mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store
96-
xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
96+
time xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
9797
9898
${systemToInstall.config.system.build.nixos-install}/bin/nixos-install --root ${systemToInstall.config.disko.rootMountPoint} --system ${systemToInstall.config.system.build.toplevel} --keep-going --no-channel-copy -v --no-root-password --option binary-caches ""
9999
umount -Rv ${systemToInstall.config.disko.rootMountPoint}

0 commit comments

Comments
 (0)