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

27 lines
750 B
Nix
Raw Normal View History

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"
2023-12-13 23:29:09 +00:00
${lib.getExe pkgs.nvd} --nix-bin-dir='${config.nix.package}/bin' diff /run/current-system "$systemConfig"
2023-05-15 18:34:08 +00:00
fi
'';
postActivation = mkIf isDarwin {
text = ''
if [[ -e /run/current-system ]]; then
echo "[show-update-changelog] System Changelog"
2023-12-13 23:29:09 +00:00
sudo -H ${lib.getExe pkgs.nvd} --nix-bin-dir='${config.nix.package}/bin' diff /run/current-system "$systemConfig"
2023-05-15 18:34:08 +00:00
fi
'';
};
};
2023-05-14 19:24:19 +00:00
}