flake.nix: add `nix store diff-closures` to microvm-update-*

This commit is contained in:
Astro 2022-06-17 23:23:31 +02:00
parent 6508600c80
commit 0f7d6a3c7c
1 changed files with 14 additions and 1 deletions

View File

@ -253,10 +253,17 @@
cd /var/lib/microvms/${name}
chown root:kvm .
chmod 0775 .
rm -f old
[ -e current ] && mv current old
nix build -L \
-o current \
${self}#nixosConfigurations.${name}.config.microvm.declaredRunner
echo '${selfRef}' > flake
[ -e old ] && nix store diff-closures ./old ./current
systemctl restart microvm@${name}.service
END
'';
@ -270,9 +277,15 @@
cd /var/lib/microvms/${name}
chown root:kvm .
chmod 0775 .
rm -f current
rm -f old
[ -e current ] && mv current old
ln -s ${hostConfig.microvm.declaredRunner} current
echo '${selfRef}' > flake
[ -e old ] && nix store diff-closures ./old ./current
systemctl restart microvm@${name}.service
END
'';