diff options
| author | David Morgan <djm_uk@protonmail.com> | 2026-06-15 17:04:04 +0100 |
|---|---|---|
| committer | David Morgan <djm_uk@protonmail.com> | 2026-06-15 17:04:04 +0100 |
| commit | d8d01b607399ca5c92e3b2d51ce4a654d632442e (patch) | |
| tree | ba54cf06a6d26e0ea0e269698b15b72833b6f21b /nix-conf/pkgs/scripts/home-changes-report.nix | |
| parent | 79f8a01a0021b84adda957f375bfeb604bca04f7 (diff) | |
| download | dotfiles-d8d01b607399ca5c92e3b2d51ce4a654d632442e.tar.gz | |
Add diff-closures scripts
And update changes-report ones
Diffstat (limited to 'nix-conf/pkgs/scripts/home-changes-report.nix')
| -rw-r--r-- | nix-conf/pkgs/scripts/home-changes-report.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nix-conf/pkgs/scripts/home-changes-report.nix b/nix-conf/pkgs/scripts/home-changes-report.nix new file mode 100644 index 0000000..62c5d99 --- /dev/null +++ b/nix-conf/pkgs/scripts/home-changes-report.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: + +# https://github.com/gvolpe/nix-config/blob/e28a220d0087064e6bad6b992b4914a65eb545e5/home/scripts/changes-report.nix +pkgs.writeShellScriptBin "home-changes-report" '' + hm_profiles="$HOME/.local/state/nix/profiles/home-manager-*-link" + + # Skip the diff if there are fewer than 2 hm profiles. + if [ $(ls -d1v $hm_profiles 2>/dev/null | wc -l) -lt 2 ]; then + echo "Skipping changes report..." + else + ${lib.getExe pkgs.dix} $(ls -d1v $hm_profiles | tail -2) + fi +'' |