Skip to content

Commit

Permalink
feat(nix): enable nvd diff output
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Mar 4, 2024
1 parent 01400bb commit 8aff530
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nix/modules/darwin/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ in {
nixfmt
nix-index
nix-prefetch-git
nvd
];

nix = let
Expand Down Expand Up @@ -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;
};
};
}
7 changes: 7 additions & 0 deletions nix/modules/nixos/system/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ in {
nixfmt
nix-index
nix-prefetch-git
nvd
];

nix = let
Expand Down Expand Up @@ -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"
'';
};
};
}

0 comments on commit 8aff530

Please sign in to comment.