diff options
Diffstat (limited to 'scripts/why-depends')
| -rwxr-xr-x | scripts/why-depends | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/why-depends b/scripts/why-depends new file mode 100755 index 00000000..1afe9150 --- /dev/null +++ b/scripts/why-depends @@ -0,0 +1,23 @@ +#! /usr/bin/env sh + +search_string="$1-" +shift 1 + +if [ "$1" != "" ]; then + # Add the version + search_string="${search_string}${1}$" + shift 1 +fi + +if [ "$1" = "--running" ]; then + shift 1 + base="/run/current-system" +else + host="$(hostname)" + base=".#nixosConfigurations.$host.config.system.build.toplevel" +fi + + +fd "$search_string" /nix/store --type directory --threads 1 --exec nix why-depends "$@" "$base" + +# vim: ft=sh |
