This commit is contained in:
Primrose 2025-05-20 00:21:10 +02:00
parent 76557154c7
commit 079e7acf26
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
5 changed files with 0 additions and 81 deletions

View file

@ -47,7 +47,6 @@ in rec {
typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {};
webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {};
nd = pkgs.callPackage ./nd {};
xbrightness = pkgs.callPackage ./xbrightness.nix {};
ffgun = pkgs.callPackage ./ffgun.nix {};
easyscan = pkgs.callPackage ./easyscan.nix {};

View file

@ -1,13 +0,0 @@
{
writeShellApplication,
nix-output-monitor,
nvd,
}:
writeShellApplication {
name = "nd";
runtimeInputs = [
nix-output-monitor
nvd
];
text = builtins.readFile ./nd.sh;
}

View file

@ -1,65 +0,0 @@
bold=$(tput bold)
normal=$(tput sgr0)
this_hash="latest"
while [ $# -gt 0 ]; do
case "$1" in
--clean*)
shopt -s nullglob
for link in nix-diff*; do
set -x
unlink "$link"
set +x
done
exit
;;
--last*)
if [[ "$1" != *=* ]]; then shift; fi
last_hash=$(git rev-parse "${1#*=}")
;;
--this*)
if [[ "$1" != *=* ]]; then shift; fi
this_hash=$(git rev-parse "${1#*=}")
;;
--hostname* | --host*)
if [[ "$1" != *=* ]]; then shift; fi
hostname="${1#*=}"
;;
*)
echo "Error: unknown argument $1"
exit 1
;;
esac
shift
done
build_config() {
hash="$1"
link="nix-diff-${hostname}-${hash:0:7}"
if [ "$hash" = latest ]; then
# build the dirty worktree configuration
ref=".#nixosConfigurations.${hostname}.config.system.build.toplevel"
else
ref=".?ref=${hash}#nixosConfigurations.${hostname}.config.system.build.toplevel"
fi
if [ -L "$link" ]; then
echo "Found link ${bold}$link${normal}"
else
echo "Starting configuration build at ${bold}$hash${normal}"
nix build "$ref" --out-link "$link" --log-format internal-json --verbose |& nom --json
fi
}
echo "Comparing ${bold}$hostname${normal}'s configuration of ${bold}${last_hash:0:7}${normal} and ${bold}${this_hash:0:7}${normal}"
build_config "$last_hash"
build_config "$this_hash"
echo "Diffing..."
nvd diff "nix-diff-${hostname}-${last_hash:0:7}" "nix-diff-${hostname}-${this_hash:0:7}"
# Always unlink if diffing with current dirty ref
if [ "$this_hash" = latest ]; then
unlink "nix-diff-${hostname}-${this_hash:0:7}"
fi