From b98f0f6df000e87233b502cb5768cb11ebae27ef Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 3 Dec 2025 01:09:05 +0100 Subject: scripts/why-depends: Simply and support comparison base selection --- scripts/why-depends | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/why-depends b/scripts/why-depends index 59f8d25b..01471ce2 100755 --- a/scripts/why-depends +++ b/scripts/why-depends @@ -4,11 +4,14 @@ package="$1" version="$2" shift 2 -host="$(hostname)" - -fd "$package-$version" /nix/store --type directory | while read -r dir; do - nix why-depends "$@" ".#nixosConfigurations.$host.config.system.build.toplevel" "$dir" -done +if [ "$1" = "--running" ]; then + shift 1 + base="/run/current-system" +else + host="$(hostname)" + base=".#nixosConfigurations.$host.config.system.build.toplevel" +fi +fd "$package-$version$" /nix/store --type directory --threads 1 --exec nix why-depends "$@" "$base" # vim: ft=sh -- cgit 1.4.1