Created
April 4, 2017 17:43
-
-
Save yurrriq/b11299b8e18c688f6293b72a4c2be999 to your computer and use it in GitHub Desktop.
nix dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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