From 6cbe4bd3ade9024df540cfb5dcab537773223fe9 Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Sun, 2 Mar 2025 00:26:17 +0800 Subject: [PATCH 1/3] wtfutil: rename wtf to wtfutil --- nixos/doc/manual/release-notes/rl-2505.section.md | 2 ++ pkgs/by-name/wt/{wtf => wtfutil}/package.nix | 4 ++-- pkgs/top-level/aliases.nix | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) rename pkgs/by-name/wt/{wtf => wtfutil}/package.nix (96%) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 1140e9b5ddff..7cf681b8b8cd 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -185,6 +185,8 @@ - `ast-grep` remove `sg` command to prevent conflict with `sg` command from shadow-utils. If you need legacy sg command compatibility with old code, you can use `ast-grep.override { enableLegacySg = true; }` +- rename package `wtf` to `wtfutil`. + - `python3Packages.beancount` was updated to 3.1.0. Previous major version remains available as `python3Packages.beancount_2`. - `binwalk` was updated to 3.1.0, which has been rewritten in rust. The python module is no longer available. diff --git a/pkgs/by-name/wt/wtf/package.nix b/pkgs/by-name/wt/wtfutil/package.nix similarity index 96% rename from pkgs/by-name/wt/wtf/package.nix rename to pkgs/by-name/wt/wtfutil/package.nix index 6bb27c9f932c..0648c72d9504 100644 --- a/pkgs/by-name/wt/wtf/package.nix +++ b/pkgs/by-name/wt/wtfutil/package.nix @@ -7,12 +7,12 @@ }: buildGoModule rec { - pname = "wtf"; + pname = "wtfutil"; version = "0.43.0"; src = fetchFromGitHub { owner = "wtfutil"; - repo = pname; + repo = "wtf"; rev = "v${version}"; sha256 = "sha256-DFrA4bx+wSOxmt1CVA1oNiYVmcWeW6wpfR5F1tnhyDY="; }; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 8ccf7791d8c6..2f12b0bbc463 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1607,6 +1607,7 @@ mapAliases { wmii_hg = wmii; wrapGAppsHook = wrapGAppsHook3; # Added 2024-03-26 write_stylus = styluslabs-write-bin; # Added 2024-10-09 + wtf = lib.warnOnInstantiate "'wtf' has been renamed to 'wtfutil'." wtfutil; # Added 2025-03-01 ### X ### From f6a0f156dfcaca1bdf6de46907a0c813e3c277de Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Wed, 5 Mar 2025 12:52:21 +0800 Subject: [PATCH 2/3] wtfutil: add xiaoxiangmoe as maintainer --- pkgs/by-name/wt/wtfutil/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/wt/wtfutil/package.nix b/pkgs/by-name/wt/wtfutil/package.nix index 0648c72d9504..0713eb96a996 100644 --- a/pkgs/by-name/wt/wtfutil/package.nix +++ b/pkgs/by-name/wt/wtfutil/package.nix @@ -42,7 +42,10 @@ buildGoModule rec { homepage = "https://wtfutil.com/"; changelog = "https://github.com/wtfutil/wtf/raw/v${version}/CHANGELOG.md"; license = licenses.mpl20; - maintainers = with maintainers; [ kalbasit ]; + maintainers = with maintainers; [ + xiaoxiangmoe + kalbasit + ]; mainProgram = "wtfutil"; platforms = platforms.linux ++ platforms.darwin; }; From 9b301c5b1ba08b022ef3caf5443957b319ccf5f4 Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Sun, 2 Mar 2025 01:13:55 +0800 Subject: [PATCH 3/3] wtfutil: fix wtfutil --version --- pkgs/by-name/wt/wtfutil/package.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/wt/wtfutil/package.nix b/pkgs/by-name/wt/wtfutil/package.nix index 0713eb96a996..d4f638264b13 100644 --- a/pkgs/by-name/wt/wtfutil/package.nix +++ b/pkgs/by-name/wt/wtfutil/package.nix @@ -1,9 +1,12 @@ { + lib, + stdenv, buildGoModule, fetchFromGitHub, - lib, makeWrapper, ncurses, + versionCheckHook, + nix-update-script, }: buildGoModule rec { @@ -25,18 +28,28 @@ buildGoModule rec { ldflags = [ "-s" "-w" - "-X main.version=${version}" ]; subPackages = [ "." ]; nativeBuildInputs = [ makeWrapper ]; + postPatch = '' + substituteInPlace flags/flags.go --replace-fail 'version := "dev"' 'version := "v${version}"' + ''; + postInstall = '' mv "$out/bin/wtf" "$out/bin/wtfutil" wrapProgram "$out/bin/wtfutil" --prefix PATH : "${ncurses.dev}/bin" ''; + doInstallCheck = true; + # Darwin Error: mkdir /var/empty: file exists + nativeInstallCheckInputs = lib.optional (!stdenv.hostPlatform.isDarwin) [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "Personal information dashboard for your terminal"; homepage = "https://wtfutil.com/";