8 lines
286 B
Bash
8 lines
286 B
Bash
#!/bin/sh
|
|
exec >&2
|
|
[ "${NIXREDO_ROOT-x}" != x ] || { printf "Set NIXREDO_ROOT. Set empty to use global nix store\n"; exit 127; }
|
|
|
|
f=$(realpath "$1")
|
|
drv=$(nix-store --store "$NIXREDO_ROOT" -qd "${f#$NIXREDO_ROOT}/nix/store")
|
|
nix-store --store "$NIXREDO_ROOT" -qR "${drv#$NIXREDO_ROOT}"
|