Last active
July 11, 2022 21:09
-
-
Save risicle/d2a2ccfbeccdaef76f34f37dcd412b20 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
#!/bin/bash | |
ALL_ATTRS_NIX=$(mktemp) | |
PKGS_PATH="." | |
#NIX_SYSTEM="x86_64-linux" | |
cat > "$ALL_ATTRS_NIX" <<EOF | |
{}@args: let pkgs = (import $(realpath "$PKGS_PATH") args); in with pkgs; builtins.filter (x: x != null) (builtins.map (x: if (builtins.tryEval x.drvPath).success then x else null) [ | |
EOF | |
nix-env -f "$PKGS_PATH" ${NIX_SYSTEM:+--argstr system "$NIX_SYSTEM"} -qaP --no-name >> "$ALL_ATTRS_NIX" | |
echo '])' >> "$ALL_ATTRS_NIX" | |
nix-instantiate "$ALL_ATTRS_NIX" ${NIX_SYSTEM:+--argstr system "$NIX_SYSTEM"} | cut -f1 -d '!' | sort | uniq | while read f ; do grep -El "$1" $f ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment