From 825c7d5938eb5c0f866474df4db4f074a5b31cc3 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Mon, 11 Apr 2022 18:42:29 +0300 Subject: [PATCH] dsq: pass version to the build Adopted from the way the package handles its version in releases: https://github.com/multiprocessio/dsq/blob/9a2da3c6d9f8db6b1e5c9209e0ddbe92d32c66d2/.github/workflows/releases.yml#L20 --- pkgs/tools/misc/dsq/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/dsq/default.nix b/pkgs/tools/misc/dsq/default.nix index 72a38cf1eaf..e70913114eb 100644 --- a/pkgs/tools/misc/dsq/default.nix +++ b/pkgs/tools/misc/dsq/default.nix @@ -5,6 +5,7 @@ , runCommand , nix-update-script , dsq +, testVersion , diffutils }: @@ -23,10 +24,14 @@ buildGoModule rec { nativeBuildInputs = [ diffutils ]; + ldflags = [ "-X" "main.Version=${version}" ]; + passthru = { updateScript = nix-update-script { attrPath = pname; }; tests = { + version = testVersion { package = dsq; }; + pretty-csv = runCommand "${pname}-test" { } '' mkdir "$out" cat < "$out/input.csv"