ufetch: 0.3 -> 0.4

Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
This commit is contained in:
phanirithvij 2024-11-24 08:59:25 +05:30
parent 3917762ed3
commit 7e7d48390e
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}