Skip to content

Instantly share code, notes, and snippets.

@luishfonseca
Created July 5, 2023 15:19
Show Gist options
  • Save luishfonseca/f183952a77e46ccd6ef7c907ca424517 to your computer and use it in GitHub Desktop.
Save luishfonseca/f183952a77e46ccd6ef7c907ca424517 to your computer and use it in GitHub Desktop.
dry-activate diff
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
@evanrichter
Copy link

I tweaked it a little so it works for both nix-darwin and nixos:

{ lib, pkgs, ... }: {
  system.activationScripts.postUserActivation = {
    text = ''
      ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
    '';
  } // lib.optionalAttrs pkgs.stdenv.isLinux {
    supportsDryActivation = true;
  };
}

@jdheyburn
Copy link

Thanks for sharing!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment