nixcfg/hosts/common/services/update-report.nix
2024-10-15 19:35:34 +03:00

20 lines
419 B
Nix

{ config
, lib
, pkgs
, user
, ...
}:
with lib; let
cfg = config.common.services.update-report;
in
{
options.common.services.update-report.enable = mkEnableOption "enable report after a rebuild";
config = mkIf cfg.enable {
system.activationScripts.diff = ''
if [[ -e /run/current-system ]]; then
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
fi
'';
};
}