Fix closure.sh
Usage is:
find -L $(./closure.sh inkscape) -name '*.a' -exec du -a {} + \
| sort -nr
to find large .a files
commit07e28d93846a78c1537f1a65d8aa6e1fede8d313
authorMatthew Bauer <mjbauer95@gmail.com>
dateSun 12 Feb 2017, 18:26 (10 years ago)
parent43f167e
closure.sh+1−21
@@ -1,27 +1,7 @@
11#!/usr/bin/env sh
22
3−if [ "$#" -lt 1 ]; then
4− cat <<EOF
5−
6−Usage: $0 TARGET
7−
8−Create a closure from the nixpkgs attribute "TARGET".
9−EOF
10−
11− exit 1
12−fi
13−
143target="$1"
154
165expr="with import <nixpkgs> {}; with import ./. {}; closure { targets = [$target]; }"
176
18−out=$(nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr"))
19−
20−if [ -z "$out" ]; then
21− echo "$0 failed. Exiting."
22− exit 1
23−else
24− rm -f result
25− ln -sf $out result
26− echo "Dir created at result"
27−fi
7+nix-store --no-gc-warning -r $(nix-instantiate --no-gc-warning -E "$expr")