From 2c5f6ca3da51bd4c2d9297382c7af59f77a20174 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 21 Aug 2025 19:15:19 +0200 Subject: [PATCH 1/5] hyfetch: 1.99.0 -> 2.0.1 Changelog: https://github.com/hykilpikonna/hyfetch/releases/tag/2.0.1 Diff: https://github.com/hykilpikonna/hyfetch/compare/1.99.0...2.0.1 --- pkgs/by-name/hy/hyfetch/package.nix | 50 ++++++++++++----------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/hy/hyfetch/package.nix b/pkgs/by-name/hy/hyfetch/package.nix index 2999b9b7285c..064a20cad84c 100644 --- a/pkgs/by-name/hy/hyfetch/package.nix +++ b/pkgs/by-name/hy/hyfetch/package.nix @@ -1,44 +1,28 @@ { lib, + rustPlatform, fetchFromGitHub, - python3Packages, - pciutils, installShellFiles, + makeBinaryWrapper, + pciutils, }: -python3Packages.buildPythonApplication rec { - pname = "hyfetch"; - version = "1.99.0"; - pyproject = true; - outputs = [ - "out" - "man" - ]; +rustPlatform.buildRustPackage (finalAttrs: { + pname = "hyfetch"; + version = "2.0.1"; src = fetchFromGitHub { owner = "hykilpikonna"; repo = "hyfetch"; - tag = version; - hash = "sha256-GL1/V+LgSXJ4b28PfinScDrJhU9VDa4pVi24zWEzbAk="; + tag = finalAttrs.version; + hash = "sha256-OaMwUTBBpFrco2Wcodb7+3ywdD5bXDebBFEoJYsgAbE="; }; - build-system = [ - python3Packages.setuptools - ]; - - dependencies = [ - python3Packages.typing-extensions - ]; + cargoHash = "sha256-xm8q4EG7qfaz/Ru/FVRiWIQW2Tjh9Ar0MquVQVLDSRA="; nativeBuildInputs = [ installShellFiles - ]; - - # No test available - doCheck = false; - - pythonImportsCheck = [ - "hyfetch" + makeBinaryWrapper ]; # NOTE: The HyFetch project maintains an updated version of neofetch renamed @@ -48,6 +32,8 @@ python3Packages.buildPythonApplication rec { postInstall = '' mv ./docs/neofetch.1 ./docs/neowofetch.1 installManPage ./docs/hyfetch.1 ./docs/neowofetch.1 + + install -m 755 neofetch $out/bin/neowofetch ''; postFixup = '' @@ -55,8 +41,13 @@ python3Packages.buildPythonApplication rec { --prefix PATH : ${lib.makeBinPath [ pciutils ]} ''; + outputs = [ + "out" + "man" + ]; + meta = { - description = "Neofetch with pride flags <3"; + description = "Neofetch with LGBTQ+ pride flags"; longDescription = '' HyFetch is a command-line system information tool fork of neofetch. HyFetch displays information about your system next to your OS logo @@ -66,7 +57,8 @@ python3Packages.buildPythonApplication rec { operating system or distribution you are running, what theme or icon set you are using, etc. ''; - homepage = "https://github.com/hykilpikonna/HyFetch"; + homepage = "https://github.com/hykilpikonna/hyfetch"; + changelog = "https://github.com/hykilpikonna/hyfetch/releases/tag/${finalAttrs.version}"; license = lib.licenses.mit; mainProgram = "hyfetch"; maintainers = with lib.maintainers; [ @@ -75,4 +67,4 @@ python3Packages.buildPythonApplication rec { nullcube ]; }; -} +}) From 8c006871445bb891737505c70e36fac7af2e9060 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 21 Aug 2025 20:06:04 +0200 Subject: [PATCH 2/5] hyfetch: add versionCheckHook --- pkgs/by-name/hy/hyfetch/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/hy/hyfetch/package.nix b/pkgs/by-name/hy/hyfetch/package.nix index 064a20cad84c..884e0915c70b 100644 --- a/pkgs/by-name/hy/hyfetch/package.nix +++ b/pkgs/by-name/hy/hyfetch/package.nix @@ -5,6 +5,7 @@ installShellFiles, makeBinaryWrapper, pciutils, + versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -46,6 +47,11 @@ rustPlatform.buildRustPackage (finalAttrs: { "man" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + versionCheckKeepEnvironment = [ "PATH" ]; + doInstallCheck = true; + meta = { description = "Neofetch with LGBTQ+ pride flags"; longDescription = '' From 0aa642c009b9f4d1c4f7bbae1a4dd4e9174f3a10 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 21 Aug 2025 20:07:19 +0200 Subject: [PATCH 3/5] hyfetch: add updateScript --- pkgs/by-name/hy/hyfetch/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/hy/hyfetch/package.nix b/pkgs/by-name/hy/hyfetch/package.nix index 884e0915c70b..2b3d46dbb8c3 100644 --- a/pkgs/by-name/hy/hyfetch/package.nix +++ b/pkgs/by-name/hy/hyfetch/package.nix @@ -6,6 +6,7 @@ makeBinaryWrapper, pciutils, versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -52,6 +53,8 @@ rustPlatform.buildRustPackage (finalAttrs: { versionCheckKeepEnvironment = [ "PATH" ]; doInstallCheck = true; + passthru.updateScript = nix-update-script { }; + meta = { description = "Neofetch with LGBTQ+ pride flags"; longDescription = '' From c09501bc4d5d1a84b60359fd25a98615613bcaf3 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 21 Aug 2025 20:07:30 +0200 Subject: [PATCH 4/5] hyfetch: add defelo as maintainer --- pkgs/by-name/hy/hyfetch/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/hy/hyfetch/package.nix b/pkgs/by-name/hy/hyfetch/package.nix index 2b3d46dbb8c3..200449a34646 100644 --- a/pkgs/by-name/hy/hyfetch/package.nix +++ b/pkgs/by-name/hy/hyfetch/package.nix @@ -74,6 +74,7 @@ rustPlatform.buildRustPackage (finalAttrs: { yisuidenghua isabelroses nullcube + defelo ]; }; }) From 35acc490c5f1fab0898fb2c12201a37b87ad0461 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 21 Aug 2025 21:56:42 +0200 Subject: [PATCH 5/5] hyfetch: install shell completions --- pkgs/by-name/hy/hyfetch/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/hy/hyfetch/package.nix b/pkgs/by-name/hy/hyfetch/package.nix index 200449a34646..92ac46b0b59f 100644 --- a/pkgs/by-name/hy/hyfetch/package.nix +++ b/pkgs/by-name/hy/hyfetch/package.nix @@ -3,6 +3,7 @@ rustPlatform, fetchFromGitHub, installShellFiles, + stdenv, makeBinaryWrapper, pciutils, versionCheckHook, @@ -36,6 +37,12 @@ rustPlatform.buildRustPackage (finalAttrs: { installManPage ./docs/hyfetch.1 ./docs/neowofetch.1 install -m 755 neofetch $out/bin/neowofetch + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd hyfetch \ + --bash <($out/bin/hyfetch --bpaf-complete-style-bash) \ + --fish <($out/bin/hyfetch --bpaf-complete-style-fish) \ + --zsh <($out/bin/hyfetch --bpaf-complete-style-zsh) ''; postFixup = ''