Skip to content

Instantly share code, notes, and snippets.

@yurrriq
Created April 4, 2017 17:43
Show Gist options
  • Save yurrriq/b11299b8e18c688f6293b72a4c2be999 to your computer and use it in GitHub Desktop.
Save yurrriq/b11299b8e18c688f6293b72a4c2be999 to your computer and use it in GitHub Desktop.
nix dependencies
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
deps () {
nix-store --query --references $1
}
deriver () {
nix-store -qd $1
}
build_deps () {
deps $(deriver $1)
}
md_list () {
sed 's/^/- /'
}
abspath=$(which $1)
echo "# $1"
echo
echo "## Build dependencies"
echo
build_deps $abspath | md_list
echo
echo "## Runtime Dependencies"
echo
deps $abspath | md_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment