ufetch: 0.3 -> 0.4 (#358611)

This commit is contained in:
Masum Reza 2024-11-24 10:16:30 +05:30 committed by GitHub
commit 3f038acf2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 24 deletions

View File

@ -1,20 +0,0 @@
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 || true) | wc -l)))"
+ fi
+done
+
## UI DETECTION
parse_rcs() {

View File

@ -9,17 +9,15 @@
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "ufetch";
version = "0.3";
version = "0.4";
src = fetchFromGitLab {
owner = "jschx";
repo = "ufetch";
rev = "v${finalAttrs.version}";
hash = "sha256-1LtVCJrkdI2AUdF5d/OBCoSqjlbZI810cxtcuOs/YWs=";
hash = "sha256-icrf7OjDageBRSBD40wX2ZzCvB6T5n0jgd5aRROGqCA=";
};
patches = [ ./0001-optimize-packages-command.patch ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/licenses/${finalAttrs.pname}