nixpkgs-tools/treewideMainProgram/list_missing_main_programs.sh

22 lines
619 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash ripgrep nix
FILES_WITHOUT_MAINPROGRAM=$(rg --case-sensitive --files-without-match "mainProgram" -g 'default.nix' .)
trap "exit 0" SIGINT
for FILE in $FILES_WITHOUT_MAINPROGRAM; do
PACKAGE=$(dirname "$FILE" | sed 's|^./||')
echo "Building: $PACKAGE"
NIXPKGS_ALLOW_UNFREE=1 nix build ".#$PACKAGE" --impure || continue
if [ "$(find result/bin | wc -w)" == 1 ]; then
echo "$PACKAGE: $(ls result/bin)" >> packages.txt
elif [ "$(find result-bin/bin | wc -w)" == 1 ]; then
echo "$PACKAGE: $(ls result-bin/bin)" >> packages.txt
fi
rm result* || true
done