gunk-dev/the-valley

nix-store

source5facbe322680main's published tip history
456 bytes
1#!/usr/bin/env bash
2# The sibling of the nix stub: `nix-store --query --references <drv>` over
3# the derivations it writes. One opaque store path per input file, named by
4# the file's content, which is what makes the closure content-addressed.
5set -euo pipefail
6
7drv="${*: -1}"
8[ -f "$drv" ] || { echo "nix-store (stub): no such derivation: $drv" >&2; exit 1; }
9while read -r sum path; do
10 printf '/nix/store/%s-%s\n' "$sum" "${path//\//_}"
11done < "$drv"