From 0eaaf860d1599e496fbd2055e8c6eaa689e76ede Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Fri, 23 Aug 2024 20:19:11 +0200 Subject: [PATCH] feat(common): enable system wide diff in the activation output This helps me to review what changes could be problematic in advance. Signed-off-by: Raito Bezarius --- common/base-server.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/base-server.nix b/common/base-server.nix index 0b64935..8752fa1 100644 --- a/common/base-server.nix +++ b/common/base-server.nix @@ -60,4 +60,14 @@ security.acme.acceptTerms = true; security.acme.defaults.email = "infra@forkos.org"; + + # Enable system diffs. + system.activationScripts.system-diff = { + supportsDryActivation = true; # safe: only outputs to stdout + text = '' + if [ -e /run/current-system ]; then + PATH=$PATH:${pkgs.nix}/bin ${pkgs.nvd}/bin/nvd diff /run/current-system $systemConfig + fi + ''; + }; }