From 82cb3f1c8a4ed8cf4e135424b4a9e39435e0bc8f Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 15 Aug 2025 00:11:19 +0200 Subject: [PATCH 1/3] scmpuff: switch to versionCheckHook Signed-off-by: Christoph Heiss --- pkgs/by-name/sc/scmpuff/package.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/sc/scmpuff/package.nix b/pkgs/by-name/sc/scmpuff/package.nix index 3a8045cb002c..cbc5be6638b8 100644 --- a/pkgs/by-name/sc/scmpuff/package.nix +++ b/pkgs/by-name/sc/scmpuff/package.nix @@ -2,8 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - testers, - scmpuff, + versionCheckHook, }: buildGoModule rec { @@ -25,10 +24,9 @@ buildGoModule rec { "-X main.VERSION=${version}" ]; - passthru.tests.version = testers.testVersion { - package = scmpuff; - command = "scmpuff version"; - }; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "version"; meta = with lib; { description = "Add numbered shortcuts to common git commands"; From 1c775c9ccdf7f81c06501395c5f6b7c0941cad42 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 15 Aug 2025 00:13:58 +0200 Subject: [PATCH 2/3] scmpuff: 0.5.0 -> 0.6.0 Some quality-of-life changes to the module are also done: - use `finalAttrs` pattern instead of `rec` - update meta.description - add meta.changelog Signed-off-by: Christoph Heiss --- pkgs/by-name/sc/scmpuff/package.nix | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/sc/scmpuff/package.nix b/pkgs/by-name/sc/scmpuff/package.nix index cbc5be6638b8..b4ae7cc275f8 100644 --- a/pkgs/by-name/sc/scmpuff/package.nix +++ b/pkgs/by-name/sc/scmpuff/package.nix @@ -5,34 +5,42 @@ versionCheckHook, }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "scmpuff"; - version = "0.5.0"; + version = "0.6.0"; src = fetchFromGitHub { owner = "mroth"; repo = "scmpuff"; - rev = "v${version}"; - sha256 = "sha256-+L0W+M8sZdUSCWj9Ftft1gkRRfWMHdxon2xNnotx8Xs="; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-c8F7BgjbR/w2JH8lE2t93s8gj6cWbTQGIkgYTQp9R3U="; }; - vendorHash = "sha256-7WHVSEz3y1nxWfbxkzkfHhINLC8+snmWknHyUUpNy7c="; + vendorHash = "sha256-7xSMToc5rlxogS0N9H6siauu8i33zUA5/omqXAszDOg="; ldflags = [ "-s" "-w" - "-X main.VERSION=${version}" + # see .goreleaser.yml in the repository + "-X main.version=${finalAttrs.version}" + "-X main.commit=${finalAttrs.src.rev}" + "-X main.date=1970-01-01T00:00:00Z" + "-X main.builtBy=nixpkgs" + "-X main.treeState=clean" ]; + strictDeps = true; + doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; - versionCheckProgramArg = "version"; + versionCheckProgramArg = "--version"; meta = with lib; { - description = "Add numbered shortcuts to common git commands"; + description = "Numeric file shortcuts for common git commands"; homepage = "https://github.com/mroth/scmpuff"; + changelog = "https://github.com/mroth/scmpuff/releases/tag/v${finalAttrs.version}"; license = licenses.mit; maintainers = with maintainers; [ cpcloud ]; mainProgram = "scmpuff"; }; -} +}) From e5c971ca68d461b8015ec5bbe44fde51c40eabc1 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 15 Aug 2025 00:14:03 +0200 Subject: [PATCH 3/3] scmpuff: add myself as maintainer Signed-off-by: Christoph Heiss --- pkgs/by-name/sc/scmpuff/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sc/scmpuff/package.nix b/pkgs/by-name/sc/scmpuff/package.nix index b4ae7cc275f8..563b839475bf 100644 --- a/pkgs/by-name/sc/scmpuff/package.nix +++ b/pkgs/by-name/sc/scmpuff/package.nix @@ -40,7 +40,10 @@ buildGoModule (finalAttrs: { homepage = "https://github.com/mroth/scmpuff"; changelog = "https://github.com/mroth/scmpuff/releases/tag/v${finalAttrs.version}"; license = licenses.mit; - maintainers = with maintainers; [ cpcloud ]; + maintainers = with maintainers; [ + cpcloud + christoph-heiss + ]; mainProgram = "scmpuff"; }; })