From 598138a191db76f50a98635e68f7722b03fd2718 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:19:17 +0200 Subject: [PATCH 1/9] tokei: don't use pname in src --- pkgs/by-name/to/tokei/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 42e0ba450c75..7764c722fe22 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "XAMPPRocky"; - repo = pname; + repo = "tokei"; rev = "v${version}"; sha256 = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE="; }; From f7057320c7d4825436d7248d5317fdf6763bb663 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:18:38 +0200 Subject: [PATCH 2/9] tokei: use finalAttrs pattern --- pkgs/by-name/to/tokei/package.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 7764c722fe22..91c49ed7eba8 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -7,23 +7,21 @@ zlib, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "tokei"; version = "13.0.0-alpha.8"; src = fetchFromGitHub { owner = "XAMPPRocky"; repo = "tokei"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE="; }; useFetchCargoVendor = true; cargoHash = "sha256-LzlyrKaRjUo6JnVLQnHidtI4OWa+GrhAc4D8RkL+nmQ="; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; checkInputs = lib.optionals stdenv.hostPlatform.isDarwin [ zlib ]; @@ -43,4 +41,4 @@ rustPlatform.buildRustPackage rec { maintainers = with maintainers; [ ]; mainProgram = "tokei"; }; -} +}) From a83df17a078ca97b2ca8d9785aab9418e278b450 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:21:40 +0200 Subject: [PATCH 3/9] tokei: use tag and hash in fetchFromGitHub --- pkgs/by-name/to/tokei/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 91c49ed7eba8..7d0efd22480f 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -14,8 +14,8 @@ rustPlatform.buildRustPackage (finalAttrs: { src = fetchFromGitHub { owner = "XAMPPRocky"; repo = "tokei"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE="; + tag = "v${finalAttrs.version}"; + hash = "sha256-jCI9VM3y76RI65E5UGuAPuPkDRTMyi+ydx64JWHcGfE="; }; useFetchCargoVendor = true; From 5d6cb0e410b21605f48bdacd63976d3325b10830 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:23:26 +0200 Subject: [PATCH 4/9] tokei: remove `with lib;` --- pkgs/by-name/to/tokei/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 7d0efd22480f..7021d548e472 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -28,17 +28,17 @@ rustPlatform.buildRustPackage (finalAttrs: { # enable all output formats buildFeatures = [ "all" ]; - meta = with lib; { + meta = { description = "Program that allows you to count your code, quickly"; longDescription = '' Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language. ''; homepage = "https://github.com/XAMPPRocky/tokei"; - license = with licenses; [ + license = with lib.licenses; [ asl20 # or mit ]; - maintainers = with maintainers; [ ]; + maintainers = with lib.maintainers; [ ]; mainProgram = "tokei"; }; }) From 09c5bb16d8c34bfe3f84dbab7f02c04825adcbeb Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:26:20 +0200 Subject: [PATCH 5/9] tokei: improve meta.description --- pkgs/by-name/to/tokei/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 7021d548e472..f9991f01e485 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -29,9 +29,9 @@ rustPlatform.buildRustPackage (finalAttrs: { buildFeatures = [ "all" ]; meta = { - description = "Program that allows you to count your code, quickly"; + description = "Count your code, quickly"; longDescription = '' - Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language. + Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language. ''; homepage = "https://github.com/XAMPPRocky/tokei"; license = with lib.licenses; [ From dee1607ccced1e05fe9c3121e1893832e4c09667 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:28:38 +0200 Subject: [PATCH 6/9] tokei: add meta.changelog --- pkgs/by-name/to/tokei/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index f9991f01e485..932a7a616274 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -34,6 +34,7 @@ rustPlatform.buildRustPackage (finalAttrs: { Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language. ''; homepage = "https://github.com/XAMPPRocky/tokei"; + changelog = "https://github.com/XAMPPRocky/tokei/blob/v${finalAttrs.version}/CHANGELOG.md"; license = with lib.licenses; [ asl20 # or mit From ec4ef6302c05ce4b5240fe657aade79f56c911a3 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:34:21 +0200 Subject: [PATCH 7/9] tokei: add versionCheckHook --- pkgs/by-name/to/tokei/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 932a7a616274..0564e498891f 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -5,6 +5,7 @@ rustPlatform, libiconv, zlib, + versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -28,6 +29,10 @@ rustPlatform.buildRustPackage (finalAttrs: { # enable all output formats buildFeatures = [ "all" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + meta = { description = "Count your code, quickly"; longDescription = '' From 732bec3fe4cde6d1702227e029f6c143f3e11add Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:36:53 +0200 Subject: [PATCH 8/9] tokei: add nix-update-script --- pkgs/by-name/to/tokei/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 0564e498891f..7205d245dd54 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -6,6 +6,7 @@ libiconv, zlib, versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -33,6 +34,8 @@ rustPlatform.buildRustPackage (finalAttrs: { versionCheckProgramArg = "--version"; doInstallCheck = true; + passthru.updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; }; + meta = { description = "Count your code, quickly"; longDescription = '' From d29618c87379d75ade9d62e7c111a1d2b76e5510 Mon Sep 17 00:00:00 2001 From: Defelo Date: Thu, 22 May 2025 23:22:53 +0200 Subject: [PATCH 9/9] tokei: add defelo as maintainer --- pkgs/by-name/to/tokei/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/to/tokei/package.nix b/pkgs/by-name/to/tokei/package.nix index 7205d245dd54..da60731d9992 100644 --- a/pkgs/by-name/to/tokei/package.nix +++ b/pkgs/by-name/to/tokei/package.nix @@ -47,7 +47,7 @@ rustPlatform.buildRustPackage (finalAttrs: { asl20 # or mit ]; - maintainers = with lib.maintainers; [ ]; + maintainers = with lib.maintainers; [ defelo ]; mainProgram = "tokei"; }; })