From 975b05b7c563111a0b3df219f5c2f2cbcb33f111 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Dec 2024 05:00:43 +0100 Subject: [PATCH] sshocker: add versionCheckHook --- pkgs/by-name/ss/sshocker/package.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ss/sshocker/package.nix b/pkgs/by-name/ss/sshocker/package.nix index 4e25276a4cc2..fe3b2eaa0a46 100644 --- a/pkgs/by-name/ss/sshocker/package.nix +++ b/pkgs/by-name/ss/sshocker/package.nix @@ -2,6 +2,7 @@ lib, buildGoModule, fetchFromGitHub, + versionCheckHook, }: buildGoModule rec { @@ -17,18 +18,24 @@ buildGoModule rec { vendorHash = "sha256-D4TJ8bIahv05cE6gvF6LmcU2RzV2krjtU8t8wD6R/lY="; + nativeInstallCheckInputs = [ versionCheckHook ]; + ldflags = [ "-s" "-w" "-X=github.com/lima-vm/sshocker/pkg/version.Version=${version}" ]; + doInstallCheck = true; + + versionCheckProgramArg = [ "--version" ]; + meta = with lib; { description = "Tool for SSH, reverse sshfs and port forwarder"; - mainProgram = "sshocker"; homepage = "https://github.com/lima-vm/sshocker"; changelog = "https://github.com/lima-vm/sshocker/releases/tag/v${version}"; license = licenses.asl20; maintainers = with maintainers; [ fab ]; + mainProgram = "sshocker"; }; }