Add upgrade-diff

This commit is contained in:
Jakob Lechner 2024-05-28 20:28:15 +02:00
parent a2c01c0fda
commit 1b9d7745f4
2 changed files with 15 additions and 0 deletions

View file

@ -49,6 +49,7 @@
./udmx.nix
./uefi.nix
./unfree.nix
./upgrade-diff.nix
./wireshark.nix
./yubikey-gpg.nix
];

14
modules/upgrade-diff.nix Normal file
View file

@ -0,0 +1,14 @@
# MIT Jörg Thalheim - https://github.com/Mic92/dotfiles/blob/c6cad4e57016945c4816c8ec6f0a94daaa0c3203/nixos/modules/upgrade-diff.nix
{ config, pkgs, ... }:
{
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
if [[ -e /run/current-system ]]; then
echo "--- diff to current-system"
${pkgs.nvd}/bin/nvd --nix-bin-dir=${config.nix.package}/bin diff /run/current-system "$systemConfig"
echo "---"
fi
'';
};
}