summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-08-26 12:22:15 +0200
committerAlex Auvolat <alex@adnab.me>2023-08-26 12:22:21 +0200
commitdd4b7f6bd8ea2afcf50630048622f6efe67d653e (patch)
tree3669b9d03309a076a94d95328d232d34472850f0
parenta8dcc5daa0565cfcaf19895dbd9bcf7f1b5cd1c1 (diff)
downloaduser-config-dd4b7f6bd8ea2afcf50630048622f6efe67d653e.tar.gz
user-config-dd4b7f6bd8ea2afcf50630048622f6efe67d653e.zip
add nixusage script
-rwxr-xr-xnixusage7
1 files changed, 7 insertions, 0 deletions
diff --git a/nixusage b/nixusage
new file mode 100755
index 0000000..eb9d7ef
--- /dev/null
+++ b/nixusage
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+for link in $(find -H /nix/var/nix/gcroots -type l); do
+ ref=$(realpath $link)
+ sizeinfo=$(nix path-info -rS $ref | sort -nk2 | tail -n 1)
+ echo "$link $sizeinfo"
+done | sort -nk3