From e48fe612e22aeac96e6fc56fdcda9b09e66848eb Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 11 Nov 2024 18:02:47 +0100 Subject: [PATCH] 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. --- modules/core/nix.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/core/nix.nix b/modules/core/nix.nix index 8640ec7..eca6351 100644 --- a/modules/core/nix.nix +++ b/modules/core/nix.nix @@ -11,6 +11,17 @@ 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 = { # Use default version alias for nix package package = pkgs.nix; -- 2.44.2