1
0
Fork 0
dotfiles/system/shared/show-update-changelog.nix

26 lines
744 B
Nix

{ pkgs, config, lib, ... }:
let
inherit (lib) mkIf;
inherit (pkgs.stdenv) isDarwin;
inherit (pkgs.stdenv) isLinux;
in
{
system.activationScripts = {
show-update-changelog = mkIf isLinux ''
if [[ -e /run/current-system ]]; then
echo "[show-update-changelog] System Changelog"
${pkgs.nvd}/bin/nvd --nix-bin-dir='${config.nix.package}/bin' diff /run/current-system "$systemConfig"
fi
'';
postActivation = mkIf isDarwin {
text = ''
if [[ -e /run/current-system ]]; then
echo "[show-update-changelog] System Changelog"
sudo -H ${pkgs.nvd}/bin/nvd --nix-bin-dir='${config.nix.package}/bin' diff /run/current-system "$systemConfig"
fi
'';
};
};
}