packages: create gcroots directory

This commit is contained in:
Sandro - 2024-01-07 03:41:02 +01:00
parent 9b3046d2eb
commit 5c9aa53921
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 7 additions and 4 deletions

View File

@ -188,15 +188,18 @@ lib.attrsets.mapAttrs
rm -f old rm -f old
[ -e current ] && cp --no-dereference current old [ -e current ] && cp --no-dereference current old
''; '';
createSymlinks = name: '' createSymlinks = name: let
gcrootDir = "/nix/var/nix/gcroots/microvm";
in /* bash */ ''
if [[ -e old ]]; then if [[ -e old ]]; then
echo System package diff: echo System package diff:
nix --extra-experimental-features nix-command store diff-closures ./old ./current || true nix --extra-experimental-features nix-command store diff-closures ./old ./current || true
fi fi
ln -sfT \$PWD/current /nix/var/nix/gcroots/microvm/${name} mkdir -p ${gcrootDir}
ln -sfT \$PWD/booted /nix/var/nix/gcroots/microvm/booted-${name} ln -sfT \$PWD/current ${gcrootDir}/${name}
ln -sfT \$PWD/old /nix/var/nix/gcroots/microvm/old-${name} ln -sfT \$PWD/booted ${gcrootDir}/booted-${name}
ln -sfT \$PWD/old ${gcrootDir}/old-${name}
''; '';
in { in {