config/profiles/upgrade-diff.nix

15 lines
544 B
Nix
Raw Normal View History

2023-10-14 18:31:23 +02:00
{ config, lib, pkgs, ... }:
2023-07-19 21:59:13 +02:00
{
# nvd: https://discourse.nixos.org/t/nvd-simple-nix-nixos-version-diff-tool/12397
# module from https://github.com/luishfonseca/dotfiles/blob/ab7625ec406b48493eda701911ad1cd017ce5bc1/modules/upgrade-diff.nix
2023-10-14 18:31:23 +02:00
# gated on formatAttr which is set by nixos-generators
system.activationScripts.diff = lib.mkIf ((config.formatAttr or null) == null) {
2023-07-19 21:59:13 +02:00
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
}