optimise pacakge count command for nixos
This commit is contained in:
parent
12b68fa355
commit
9c7e593b10
1 changed files with 6 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue