From 00449eeb7d12873076a8e2cf72a4b5a4c7bbc741 Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Tue, 22 Oct 2024 10:47:41 +0200 Subject: [PATCH] nix: mitigate nix store optimisiation --- nix/cc/cryptsetup.nix | 3 ++- nix/cc/libvirt.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/cc/cryptsetup.nix b/nix/cc/cryptsetup.nix index 9687e10199b..813979944b5 100644 --- a/nix/cc/cryptsetup.nix +++ b/nix/cc/cryptsetup.nix @@ -11,7 +11,8 @@ pkgs.symlinkJoin { paths = packages; buildInputs = packages; postBuild = '' - tar -cf $out/closure.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name ${closure} + # TODO(burgerdev): should use gnutar! + tar -cf $out/closure.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name --hard-dereference ${closure} echo "${rpath}" > $out/rpath cp ${cc}/nix-support/dynamic-linker $out/dynamic-linker ''; diff --git a/nix/cc/libvirt.nix b/nix/cc/libvirt.nix index 47660a97f05..6187bdd173d 100644 --- a/nix/cc/libvirt.nix +++ b/nix/cc/libvirt.nix @@ -11,7 +11,8 @@ pkgs.symlinkJoin { paths = packages; buildInputs = packages; postBuild = '' - tar -cf $out/closure.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name ${closure} + # TODO(burgerdev): should use gnutar! + tar -cf $out/closure.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name --hard-dereference ${closure} tar --transform 's+^./+bin/+' -cf $out/bin-linktree.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name -C $out/bin . echo "${rpath}" > $out/rpath cp ${cc}/nix-support/dynamic-linker $out/dynamic-linker