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 63% rename from pkgs/by-name/wt/wtf/package.nix rename to pkgs/by-name/wt/wtfutil/package.nix index 6bb27c9f932c..d4f638264b13 100644 --- a/pkgs/by-name/wt/wtf/package.nix +++ b/pkgs/by-name/wt/wtfutil/package.nix @@ -1,18 +1,21 @@ { + lib, + stdenv, buildGoModule, fetchFromGitHub, - lib, makeWrapper, ncurses, + versionCheckHook, + nix-update-script, }: 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="; }; @@ -25,24 +28,37 @@ 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/"; 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; }; 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 ###