add nvd on activate

This commit is contained in:
Peder Bergebakken Sundt 2023-07-19 21:59:13 +02:00
parent 8b286d8306
commit 7aeacd1a5a
7 changed files with 28 additions and 0 deletions

View File

@ -9,6 +9,7 @@
./hardware-configuration.nix
../../hardware/gpu/intel.nix
../../profiles/auto-upgrade.nix
../../profiles/upgrade-diff.nix
../../profiles/sshd.nix
../../users # home-manager

View File

@ -18,6 +18,7 @@
../../hardware/gpu/rocm.nix
../../hardware/gpu/intel.nix
../../profiles/auto-upgrade.nix
../../profiles/upgrade-diff.nix
../../profiles/sshd.nix
../../users # home-manager

View File

@ -8,6 +8,7 @@
./hardware-configuration.nix
../../hardware/gpu/intel.nix
../../profiles/auto-upgrade.nix
../../profiles/upgrade-diff.nix
../../profiles/sshd.nix
../../profiles/podman.nix

View File

@ -24,6 +24,7 @@
../../hardware/gpu/intel.nix
../../hardware/printer/hp-laserjet-p1005.nix
../../profiles/auto-upgrade.nix
../../profiles/upgrade-diff.nix
../../profiles/sshd.nix
../../profiles/no-suspend.nix
../../profiles/podman.nix

13
profiles/upgrade-diff.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
# 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
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
}

View File

@ -12,6 +12,7 @@
./profiles/shell.nix
./profiles/ssh.nix
./profiles/tmate.nix
./profiles/update-diff.nix
];
# TODO: add remote-exec once packaged

View File

@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
# nvd: https://discourse.nixos.org/t/nvd-simple-nix-nixos-version-diff-tool/12397
# module from https://infosec.exchange/@wyndon/110662698348958506
home.activation.diff-update = config.lib.dag.entryAnywhere ''
${pkgs.nvd}/bin/nvd diff $oldGenPath $newGenPath
'';
}