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
This commit is contained in:
Olli Helenius
2022-04-11 18:46:31 +03:00
parent bc50e0ec12
commit 825c7d5938
+5
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"