From 65c166c4afb489bb45ac3aec9c8e41cd2137b4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 28 May 2024 19:47:42 +0200 Subject: [PATCH] Fix flakestat after unstable switch --- home/hyprland/waybar/flakestat.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/home/hyprland/waybar/flakestat.sh b/home/hyprland/waybar/flakestat.sh index 7e699ef..175dd6c 100644 --- a/home/hyprland/waybar/flakestat.sh +++ b/home/hyprland/waybar/flakestat.sh @@ -5,22 +5,16 @@ NIXPKGS_DIR="/home/torjus/git/nixpkgs" flake_metadata=$(nix flake metadata --json "$FLAKE_DIR" 2>/dev/null) -stable_input=$(echo "$flake_metadata" | jq '.locks.nodes.root.inputs.nixpkgs') -stable_rev=$(echo "$flake_metadata" | jq -r ".locks.nodes.$stable_input.locked.rev") -stable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$stable_input.original.ref") - -unstable_input=$(echo "$flake_metadata" | jq '.locks.nodes.root.inputs."nixpkgs-unstable"') +unstable_input=$(echo "$flake_metadata" | jq '.locks.nodes.root.inputs.nixpkgs') unstable_rev=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.locked.rev") unstable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.original.ref") cd "$NIXPKGS_DIR" || exit 1 git fetch -q --all -stable_commit_count=$(git rev-list --count "$stable_rev..origin/$stable_branch") unstable_commit_count=$(git rev-list --count "$unstable_rev..origin/$unstable_branch") -text="$stable_commit_count|$unstable_commit_count" -tooltip="${stable_branch}: ${stable_commit_count} -${unstable_branch}: ${unstable_commit_count}" +text="$unstable_commit_count" +tooltip="${unstable_branch}: ${unstable_commit_count}" output=$(jq -n \ --arg text "$text" \