2023-05-15 18:34:08 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2023-05-14 19:24:19 +00:00
|
|
|
|
2023-05-15 18:34:08 +00:00
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
inherit (pkgs.stdenv) isDarwin;
|
|
|
|
inherit (pkgs.stdenv) isLinux;
|
|
|
|
in
|
2023-05-14 19:24:19 +00:00
|
|
|
{
|
2023-05-15 18:34:08 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-05-14 19:24:19 +00:00
|
|
|
}
|