diff options
Diffstat (limited to '')
-rwxr-xr-x | scripts/pretty-rebuild | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/pretty-rebuild b/scripts/pretty-rebuild new file mode 100755 index 0000000..30025bb --- /dev/null +++ b/scripts/pretty-rebuild @@ -0,0 +1,16 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i zsh --packages zsh + +cd /etc/nixos && \ + nix flake update && \ + cd && \ + nixos-rebuild switch --upgrade --show-trace && \ + echo && \ + nixos-rebuild list-generations | cat && \ + echo && \ + res=$(find /nix/var/nix/profiles -iname system-\* -type l | sort | tail -2) + +if [[ ${?} -eq 0 && $(echo -E "${res}" | wc -l) -eq 2 ]]; then + echo "+ diff between $(echo -E "${res}" | xargs)\n" + nix store diff-closures $(echo -E "${res}" | xargs) +fi |