Last active
August 7, 2023 16:49
-
-
Save Mic92/fee7b25d1d7f7451d6e34f6c3db14f28 to your computer and use it in GitHub Desktop.
This file contains 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 sqlite -p bash | |
SQL=$(cat <<EOF | |
select * from DerivationOutputs do | |
inner join ValidPaths vp on vp.id = do.drv | |
inner join Refs r1 on r1.referrer = vp.id | |
inner join ValidPaths vp2 on r1.reference = vp2.id | |
where do.path GLOB '/nix/store/$1-*' | |
EOF | |
) | |
sqlite3 -readonly /nix/var/nix/db/db.sqlite "$SQL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment