From 7a764a9ef01587a6c9d17321aa5067087474f068 Mon Sep 17 00:00:00 2001 From: agryphus Date: Tue, 5 Dec 2023 22:13:00 -0500 Subject: [PATCH] More informative nixos-rebuild output --- .local/bin/overrides/nixos-rebuild | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 .local/bin/overrides/nixos-rebuild diff --git a/.local/bin/overrides/nixos-rebuild b/.local/bin/overrides/nixos-rebuild new file mode 100755 index 0000000..fd525e6 --- /dev/null +++ b/.local/bin/overrides/nixos-rebuild @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +# Since the below command is piped into nom, it has weird output if the sudo password +# has to be prompted. Add a dummy command to make sure a valid token exists (assuming the +# user's sudo config saves sudo password for some time after entry) +sudo echo + +# Rebuild, pipe into output monitor to build a live dependency graph +sudo $(sysbin nixos-rebuild) "$@" |& nom + +# Print diff +ls -v1 /nix/var/nix/profiles | tail -n 2 | awk '{print "/nix/var/nix/profiles/" $0}' - | xargs nvd diff +