at main 522 B view raw
1# Thank you https://github.com/luishfonseca/dotfiles/blob/ab7625ec406b48493eda701911ad1cd017ce5bc1/modules/upgrade-diff.nix 2{ 3 lib, 4 pkgs, 5 ... 6}: 7{ 8 system.activationScripts.diff = { 9 supportsDryActivation = true; 10 text = '' 11 if [[ -e /run/current-system ]]; then 12 ${lib.getExe pkgs.nvd} --color always --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" 13 else 14 echo "Couldn't find /run/current-system. Are we booting? Exiting gracefully." 15 fi 16 ''; 17 }; 18}