diff --git a/ufetch-nixos b/ufetch-nixos index 2ca8f9d..5102cd7 100755 --- a/ufetch-nixos +++ b/ufetch-nixos @@ -9,9 +9,14 @@ host="$(hostname)" os="$(nixos-version)" kernel="$(uname -sr)" uptime="$(uptime | awk -F, '{sub(".*up ",x,$1);print $1}' | sed -e 's/^[ \t]*//')" -packages="$(ls -d -1 /nix/store/*/ | wc -l)" shell="$(basename "${SHELL}")" +for profile in $NIX_PROFILES; do + if [ -d "$profile" ]; then + packages="$((packages + $( (nix-store -q --requisites "$profile" 2>/dev/null || printf '') | wc -l)))" + fi +done + ## UI DETECTION parse_rcs() {