dsq: pass version to the build

Adopted from the way the package handles its version in releases:

    9a2da3c6d9/.github/workflows/releases.yml (L20)
This commit is contained in:
Olli Helenius 2022-04-11 18:42:29 +03:00
parent bc50e0ec12
commit 825c7d5938
No known key found for this signature in database
GPG Key ID: 67235CC88F41DE3C

View File

@ -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 <<EOF > "$out/input.csv"