From 22cd4b7e491a2a95fb9bca0dfb5904e01569e87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 5 Dec 2024 08:42:49 +0100 Subject: [PATCH] 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 --- disko-install | 2 +- lib/make-disk-image.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/disko-install b/disko-install index 4f0a8b7..2c5596e 100755 --- a/disko-install +++ b/disko-install @@ -253,7 +253,7 @@ main() { # nix copy uses up a lot of memory and we work around issues with incorrect checksums in our store # that can be caused by using closureInfo in combination with multiple builders and non-deterministic builds. # Therefore if we have a blank store, we copy the store paths and registration from the closureInfo. - if [[ ! -d "${mountPoint}/nix/store" ]]; then + if [[ ! -f "${mountPoint}/nix/var/nix/db/db.sqlite" ]]; then echo "Copying store paths" >&2 mkdir -p "${mountPoint}/nix/store" xargs cp --recursive --target "${mountPoint}/nix/store" < "${closure_info}/store-paths" diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 748aa62..de17ee1 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -93,7 +93,7 @@ let # We copy files with cp because `nix copy` seems to have a large memory leak mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store - xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths + time xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths ${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 "" umount -Rv ${systemToInstall.config.disko.rootMountPoint} -- knotmirror 0.0.1