mirror of
https://gitlab.com/jschx/ufetch.git
synced 2026-09-30 21:42:51 +07:00
optimise pacakge count command for nixos
This commit is contained in:
+6
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user