Skip to content

Commit

Permalink
hosts: features: upgrade-diff: use nvd for nicer outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <[email protected]>
  • Loading branch information
otavio committed Sep 30, 2023
1 parent b195a23 commit 05fe314
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions hosts/features/required/upgrade-diff.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# MIT Jörg Thalheim - https://github.com/Mic92/dotfiles/blob/c6cad4e57016945c4816c8ec6f0a94daaa0c3203/nixos/modules/upgrade-diff.nix
{ pkgs, ... }:
{ config, pkgs, ... }:
{
system.activationScripts.diff = ''
if [[ -e /run/current-system ]]; then
${pkgs.nix}/bin/nix --extra-experimental-features nix-command store diff-closures /run/current-system "$systemConfig"
fi
'';
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
'';
};
}

0 comments on commit 05fe314

Please sign in to comment.