diff --git a/nix/modules/darwin/nix/default.nix b/nix/modules/darwin/nix/default.nix index 789805a..5ad62ee 100644 --- a/nix/modules/darwin/nix/default.nix +++ b/nix/modules/darwin/nix/default.nix @@ -20,6 +20,7 @@ in { nixfmt nix-index nix-prefetch-git + nvd ]; nix = let @@ -68,5 +69,14 @@ in { generateNixPathFromInputs = true; linkInputs = true; }; + system.activationScripts.postUserActivation = + { + text = '' + ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" + ''; + } + // lib.optionalAttrs pkgs.stdenv.isLinux { + supportsDryActivation = true; + }; }; } diff --git a/nix/modules/nixos/system/nix/default.nix b/nix/modules/nixos/system/nix/default.nix index 33ae4fe..9619c45 100644 --- a/nix/modules/nixos/system/nix/default.nix +++ b/nix/modules/nixos/system/nix/default.nix @@ -26,6 +26,7 @@ in { nixfmt nix-index nix-prefetch-git + nvd ]; nix = let @@ -65,5 +66,11 @@ in { generateNixPathFromInputs = true; linkInputs = true; }; + system.activationScripts.diff = { + supportsDryActivation = true; + text = '' + ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" + ''; + }; }; }