From 2ba52baf4aaa20f334723a7dbdc4f0961df2b8e4 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 18 Jul 2026 15:14:47 -0400 Subject: [PATCH] nix/tg: remove wrapProgram, use git as check input and run tests --- nix/tg.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/nix/tg.nix b/nix/tg.nix index 115d168..bfb9c6e 100644 --- a/nix/tg.nix +++ b/nix/tg.nix @@ -2,7 +2,6 @@ buildGoModule, lib, installShellFiles, - makeWrapper, stdenv, git, }: @@ -13,15 +12,18 @@ buildGoModule { vendorHash = "sha256-vAjC3nyJvXVvsBj+JXPN7dNPAdhwY64lqHLsOhTuVKc="; subPackages = ["cmd/tg"]; - nativeBuildInputs = [ - installShellFiles - makeWrapper - ]; - postInstall = '' - wrapProgram $out/bin/tg --prefix PATH : ${lib.makeBinPath [git]} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + nativeBuildInputs = [installShellFiles]; + nativeCheckInputs = [git]; + doCheck = true; + + checkPhase = '' + runHook preCheck + go test ./... + runHook postCheck + ''; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # Man page dates stay reproducible because stdenv sets SOURCE_DATE_EPOCH, # which cobra/doc reads when GenManHeader.Date is unset. manPageDir=$(mktemp -d) -- 2.51.2