core: add activationScript to show closure diff

This is useful when updating a host, by doing a dry-run with deploy-rs
we get a list of changed package versions.
This commit is contained in:
teutat3s 2024-11-11 18:02:47 +01:00
parent da529b023e
commit e48fe612e2
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -11,6 +11,17 @@
permittedInsecurePackages = [ "olm-3.2.16" ]; permittedInsecurePackages = [ "olm-3.2.16" ];
}; };
system.activationScripts.diff-closures = {
text = ''
if [[ -e /run/current-system ]]; then
${config.nix.package}/bin/nix store diff-closures \
/run/current-system "$systemConfig" \
--extra-experimental-features nix-command
fi
'';
supportsDryActivation = true;
};
nix = { nix = {
# Use default version alias for nix package # Use default version alias for nix package
package = pkgs.nix; package = pkgs.nix;