#! /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