diff --git a/pkgs/by-name/al/alephone/package.nix b/pkgs/by-name/al/alephone/package.nix index 79a228259960cac..200ff3d1a507941 100644 --- a/pkgs/by-name/al/alephone/package.nix +++ b/pkgs/by-name/al/alephone/package.nix @@ -26,10 +26,10 @@ SDL2_ttf, speex, unzip, + versionCheckHook, zlib, zziplib, alephone, - testers, }: stdenv.mkDerivation (finalAttrs: { @@ -86,6 +86,10 @@ stdenv.mkDerivation (finalAttrs: { zziplib ]; + # test that the version is correct + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ]; makeFlags = [ "AR:=$(AR)" ]; @@ -101,10 +105,6 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - passthru.tests.version = - # test that the version is correct - testers.testVersion { package = alephone; }; - meta = { description = "Aleph One is the open source continuation of Bungie’s Marathon 2 game engine"; mainProgram = "alephone"; diff --git a/pkgs/by-name/am/amazon-ssm-agent/package.nix b/pkgs/by-name/am/amazon-ssm-agent/package.nix index b22f8a41518add5..1ccb0ab14bb2b20 100644 --- a/pkgs/by-name/am/amazon-ssm-agent/package.nix +++ b/pkgs/by-name/am/amazon-ssm-agent/package.nix @@ -12,8 +12,7 @@ , bashInteractive , nix-update-script , nixosTests -, testers -, amazon-ssm-agent +, versionCheckHook }: let @@ -143,13 +142,12 @@ buildGoModule rec { --prefix PATH : "${lib.makeBinPath [ bashInteractive ]}" ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { tests = { inherit (nixosTests) amazon-ssm-agent; - version = testers.testVersion { - package = amazon-ssm-agent; - command = "amazon-ssm-agent --version"; - }; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/an/ansible-cmdb/package.nix b/pkgs/by-name/an/ansible-cmdb/package.nix index f23da79053c644f..130a956f7d6c2cc 100644 --- a/pkgs/by-name/an/ansible-cmdb/package.nix +++ b/pkgs/by-name/an/ansible-cmdb/package.nix @@ -3,8 +3,7 @@ fetchFromGitHub, substituteAll, python3Packages, - testers, - ansible-cmdb, + versionCheckHook, }: let inherit (python3Packages) @@ -45,10 +44,7 @@ buildPythonApplication { jsonxs ]; - passthru.tests.version = testers.testVersion { - package = ansible-cmdb; - version = "v${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "Generate host overview from ansible fact gathering output"; diff --git a/pkgs/by-name/ap/aphorme/package.nix b/pkgs/by-name/ap/aphorme/package.nix index 153de3c7b74cbee..52b23b816faa596 100644 --- a/pkgs/by-name/ap/aphorme/package.nix +++ b/pkgs/by-name/ap/aphorme/package.nix @@ -5,9 +5,8 @@ , libxkbcommon , libGL , stdenv -, testers -, aphorme , autoPatchelfHook +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -35,11 +34,8 @@ rustPlatform.buildRustPackage rec { libxkbcommon ]; - passthru.tests.version = testers.testVersion { - package = aphorme; - command = "aphorme --version"; - version = "aphorme ${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Program launcher for window managers, written in Rust"; diff --git a/pkgs/by-name/ap/apvlv/package.nix b/pkgs/by-name/ap/apvlv/package.nix index 77ad5a034daaecb..8049a22b75f47d7 100644 --- a/pkgs/by-name/ap/apvlv/package.nix +++ b/pkgs/by-name/ap/apvlv/package.nix @@ -15,12 +15,11 @@ libxml2, libxshmfence, man, - nix-update-script, pcre, pkg-config, poppler, stdenv, - testers, + versionCheckHook, webkitgtk, wrapGAppsHook3, }: @@ -89,13 +88,10 @@ stdenv.mkDerivation (finalAttrs: { "../apvlv.desktop" ]; - passthru = { - tests.version = testers.testVersion { - command = "${lib.getExe finalAttrs.finalPackage} -v"; - package = finalAttrs.finalPackage; - version = "${finalAttrs.version}-rel"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "-v"; meta = { changelog = "https://github.com/naihe2010/apvlv/blob/v${finalAttrs.version}/NEWS"; diff --git a/pkgs/by-name/ar/artalk/package.nix b/pkgs/by-name/ar/artalk/package.nix index ff2e0be2abdcc9b..67e2c8485b4b9d3 100644 --- a/pkgs/by-name/ar/artalk/package.nix +++ b/pkgs/by-name/ar/artalk/package.nix @@ -2,11 +2,10 @@ lib, buildGoModule, fetchFromGitHub, - artalk, fetchurl, installShellFiles, stdenv, - testers, + versionCheckHook, }: buildGoModule rec { pname = "artalk"; @@ -41,6 +40,9 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + postInstall = '' # work around case insensitive file systems @@ -54,10 +56,6 @@ buildGoModule rec { --zsh <($out/bin/artalk completion zsh) ''; - passthru.tests = { - version = testers.testVersion { package = artalk; }; - }; - meta = { description = "Self-hosted comment system"; homepage = "https://github.com/ArtalkJS/Artalk"; diff --git a/pkgs/by-name/at/athens/package.nix b/pkgs/by-name/at/athens/package.nix index 53cba1793a3eab1..84958e938401388 100644 --- a/pkgs/by-name/at/athens/package.nix +++ b/pkgs/by-name/at/athens/package.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub , buildGoModule -, testers -, athens +, versionCheckHook }: buildGoModule rec { pname = "athens"; @@ -26,11 +25,8 @@ buildGoModule rec { mv $out/bin/proxy $out/bin/athens ''; - passthru = { - tests.version = testers.testVersion { - package = athens; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Go module datastore and proxy"; diff --git a/pkgs/by-name/aw/awscli2/package.nix b/pkgs/by-name/aw/awscli2/package.nix index ff441ea316c6e6e..4b6808ea63bef84 100644 --- a/pkgs/by-name/aw/awscli2/package.nix +++ b/pkgs/by-name/aw/awscli2/package.nix @@ -7,8 +7,7 @@ , fetchpatch , installShellFiles , nix-update-script -, testers -, awscli2 +, versionCheckHook }: let @@ -121,6 +120,8 @@ py.pkgs.buildPythonApplication rec { pytestCheckHook ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + postInstall = '' installShellCompletion --cmd aws \ --bash <(echo "complete -C $out/bin/aws_completer aws") \ @@ -154,17 +155,14 @@ py.pkgs.buildPythonApplication rec { "awscli" ]; + versionCheckProgram = "${placeholder "out"}/bin/aws"; + passthru = { python = py; # for aws_shell updateScript = nix-update-script { # Excludes 1.x versions from the Github tags list extraArgs = [ "--version-regex" "^(2\.(.*))" ]; }; - tests.version = testers.testVersion { - package = awscli2; - command = "aws --version"; - inherit version; - }; }; meta = with lib; { diff --git a/pkgs/by-name/ba/basedpyright/package.nix b/pkgs/by-name/ba/basedpyright/package.nix index 73b896ea7cdf6f3..8be34b42d4b9029 100644 --- a/pkgs/by-name/ba/basedpyright/package.nix +++ b/pkgs/by-name/ba/basedpyright/package.nix @@ -6,8 +6,7 @@ buildNpmPackage, python3, stdenvNoCC, - testers, - basedpyright, + versionCheckHook }: let @@ -112,9 +111,11 @@ buildNpmPackage rec { dontNpmBuild = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = ./update.sh; - tests.version = testers.testVersion { package = basedpyright; }; }; meta = { diff --git a/pkgs/by-name/be/benchexec/package.nix b/pkgs/by-name/be/benchexec/package.nix index 213aeee6d919d5e..809950083c3ba5c 100644 --- a/pkgs/by-name/be/benchexec/package.nix +++ b/pkgs/by-name/be/benchexec/package.nix @@ -39,6 +39,7 @@ python3.pkgs.buildPythonApplication rec { passthru.tests = let + # TODO: maybe allow `versionCheckHook` to support doing this? testVersion = result: testers.testVersion { command = "${result} --version"; package = benchexec; diff --git a/pkgs/by-name/bl/blade-formatter/package.nix b/pkgs/by-name/bl/blade-formatter/package.nix index e0f58cd80139aa5..9b9c24ee2f2704e 100644 --- a/pkgs/by-name/bl/blade-formatter/package.nix +++ b/pkgs/by-name/bl/blade-formatter/package.nix @@ -7,6 +7,7 @@ runCommand, blade-formatter, nodejs, + versionCheckHook, }: buildNpmPackage rec { @@ -26,14 +27,12 @@ buildNpmPackage rec { npmDepsHash = "sha256-wEz0DTbg+Fdmsf0Qyeu9QS+I8gkPJeaJC/3HuP913og="; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = ./update.sh; tests = { - version = testers.testVersion { - package = blade-formatter; - command = "blade-formatter --version"; - }; - simple = testers.testEqualContents { assertion = "blade-formatter formats a basic blade file"; expected = writeText "expected" '' diff --git a/pkgs/by-name/bl/blastem/package.nix b/pkgs/by-name/bl/blastem/package.nix index 6cc7e97c7c8b157..4bec09bcc0aa60c 100644 --- a/pkgs/by-name/bl/blastem/package.nix +++ b/pkgs/by-name/bl/blastem/package.nix @@ -59,6 +59,7 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + # TODO: use `versionCheckHook` when possible passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; command = "blastem -v"; diff --git a/pkgs/by-name/bl/blueutil/package.nix b/pkgs/by-name/bl/blueutil/package.nix index 9e3be68154b78e8..cbb1affe5312686 100644 --- a/pkgs/by-name/bl/blueutil/package.nix +++ b/pkgs/by-name/bl/blueutil/package.nix @@ -3,8 +3,8 @@ stdenv, fetchFromGitHub, darwin, - testers, nix-update-script, + versionCheckHook }: let @@ -37,8 +37,10 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ca/caddy/package.nix b/pkgs/by-name/ca/caddy/package.nix index d6832d396c77347..2123c9652720560 100644 --- a/pkgs/by-name/ca/caddy/package.nix +++ b/pkgs/by-name/ca/caddy/package.nix @@ -2,10 +2,9 @@ , buildGoModule , fetchFromGitHub , nixosTests -, caddy -, testers , installShellFiles , stdenv +, versionCheckHook }: let version = "2.8.4"; @@ -61,12 +60,13 @@ buildGoModule { --zsh <($out/bin/caddy completion zsh) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + passthru.tests = { inherit (nixosTests) caddy; - version = testers.testVersion { - command = "${caddy}/bin/caddy version"; - package = caddy; - }; }; meta = with lib; { diff --git a/pkgs/by-name/ca/cargo-shear/package.nix b/pkgs/by-name/ca/cargo-shear/package.nix index f5d7c2cf3d5e789..bf88d62aa0b1a9e 100644 --- a/pkgs/by-name/ca/cargo-shear/package.nix +++ b/pkgs/by-name/ca/cargo-shear/package.nix @@ -2,8 +2,7 @@ fetchFromGitHub, lib, rustPlatform, - testers, - cargo-shear, + versionCheckHook }: let version = "1.0.0"; @@ -23,9 +22,9 @@ rustPlatform.buildRustPackage { # https://github.com/Boshen/cargo-shear/blob/a0535415a3ea94c86642f39f343f91af5cdc3829/src/lib.rs#L20-L23 SHEAR_VERSION = version; - passthru.tests.version = testers.testVersion { - package = cargo-shear; - }; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Detect and remove unused dependencies from Cargo.toml"; diff --git a/pkgs/by-name/ca/castxml/package.nix b/pkgs/by-name/ca/castxml/package.nix index c4ce27fa924715d..3a2796579c42459 100644 --- a/pkgs/by-name/ca/castxml/package.nix +++ b/pkgs/by-name/ca/castxml/package.nix @@ -7,7 +7,7 @@ llvmPackages, python3, stdenv, - testers, + versionCheckHook, zlib, # Boolean flags withHTML ? true, @@ -59,9 +59,8 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - passthru.tests = testers.testVersion { - package = finalAttrs.finalPackage; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { homepage = "https://github.com/CastXML/CastXML"; diff --git a/pkgs/by-name/ce/cemu/package.nix b/pkgs/by-name/ce/cemu/package.nix index da0eb8d9a873207..b63c38c72eedac3 100644 --- a/pkgs/by-name/ce/cemu/package.nix +++ b/pkgs/by-name/ce/cemu/package.nix @@ -25,7 +25,7 @@ pugixml, rapidjson, stdenv, - testers, + versionCheckHook, vulkan-headers, vulkan-loader, wayland, @@ -144,13 +144,11 @@ in stdenv.mkDerivation (finalAttrs: { ) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - }; }; meta = { diff --git a/pkgs/by-name/ce/centrifugo/package.nix b/pkgs/by-name/ce/centrifugo/package.nix index 82601a7fba63704..a3c2cbc0d9d918b 100644 --- a/pkgs/by-name/ce/centrifugo/package.nix +++ b/pkgs/by-name/ce/centrifugo/package.nix @@ -3,8 +3,7 @@ , fetchFromGitHub , nix-update-script , nixosTests -, testers -, centrifugo +, versionCheckHook }: let # Inspect build flags with `go version -m centrifugo`. @@ -37,15 +36,15 @@ buildGoModule rec { "./internal/gen/api" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + passthru = { updateScript = nix-update-script { }; tests = { inherit (nixosTests) centrifugo; - version = testers.testVersion { - package = centrifugo; - command = "${pname} version"; - version = "v${version}"; - }; }; }; diff --git a/pkgs/by-name/cl/cljfmt/package.nix b/pkgs/by-name/cl/cljfmt/package.nix index 2e0a07fe5d5e3e4..2e73e745d504853 100644 --- a/pkgs/by-name/cl/cljfmt/package.nix +++ b/pkgs/by-name/cl/cljfmt/package.nix @@ -2,8 +2,7 @@ , buildGraalvmNativeImage , fetchurl , nix-update-script -, testers -, cljfmt +, versionCheckHook }: buildGraalvmNativeImage rec { @@ -26,11 +25,8 @@ buildGraalvmNativeImage rec { passthru.updateScript = nix-update-script { }; - passthru.tests.version = testers.testVersion { - inherit version; - package = cljfmt; - command = "cljfmt --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { mainProgram = "cljfmt"; diff --git a/pkgs/by-name/cl/clojure-lsp/package.nix b/pkgs/by-name/cl/clojure-lsp/package.nix index fc5ca91fb74027a..3b64875eb2497cf 100644 --- a/pkgs/by-name/cl/clojure-lsp/package.nix +++ b/pkgs/by-name/cl/clojure-lsp/package.nix @@ -6,8 +6,7 @@ fetchFromGitHub, clojure, writeScript, - testers, - clojure-lsp, + versionCheckHook }: buildGraalvmNativeImage rec { @@ -48,11 +47,8 @@ buildGraalvmNativeImage rec { runHook postCheck ''; - passthru.tests.version = testers.testVersion { - inherit version; - package = clojure-lsp; - command = "clojure-lsp --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; passthru.updateScript = writeScript "update-clojure-lsp" '' #!/usr/bin/env nix-shell diff --git a/pkgs/by-name/cm/cmake-lint/package.nix b/pkgs/by-name/cm/cmake-lint/package.nix index b683a0aaa8c519b..c3fc21f1289913f 100644 --- a/pkgs/by-name/cm/cmake-lint/package.nix +++ b/pkgs/by-name/cm/cmake-lint/package.nix @@ -2,8 +2,7 @@ lib, fetchFromGitHub, python3Packages, - testers, - cmake-lint, + versionCheckHook }: python3Packages.buildPythonApplication rec { @@ -27,13 +26,13 @@ python3Packages.buildPythonApplication rec { nose ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + checkPhase = '' nosetests ''; - passthru.tests = { - version = testers.testVersion { package = cmake-lint; }; - }; + versionCheckProgram = "cmakelint"; meta = { description = "Static code checker for CMake files"; diff --git a/pkgs/by-name/co/codefresh/package.nix b/pkgs/by-name/co/codefresh/package.nix index 36792f48dfaa370..07023c06173f7ca 100644 --- a/pkgs/by-name/co/codefresh/package.nix +++ b/pkgs/by-name/co/codefresh/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarnConfigHook, npmHooks, nodejs, testers }: +{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarnConfigHook, npmHooks, nodejs, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { pname = "codefresh"; @@ -23,11 +23,10 @@ stdenv.mkDerivation (finalAttrs: { # Tries to fetch stuff from the internet dontNpmPrune = true; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - # codefresh needs to read a config file, this is faked out with a subshell - command = "codefresh --cfconfig <(echo 'contexts:') version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "--cfconfig <(echo 'contexts:') version"; meta = { changelog = "https://github.com/codefresh-io/cli/releases/tag/v${finalAttrs.version}"; diff --git a/pkgs/by-name/co/commitlint-rs/package.nix b/pkgs/by-name/co/commitlint-rs/package.nix index 9b31e6cfd309447..afa15be898c2be9 100644 --- a/pkgs/by-name/co/commitlint-rs/package.nix +++ b/pkgs/by-name/co/commitlint-rs/package.nix @@ -3,8 +3,7 @@ lib, nix-update-script, rustPlatform, - testers, - commitlint-rs, + versionCheckHook, }: rustPlatform.buildRustPackage rec { pname = "commitlint-rs"; @@ -18,9 +17,11 @@ rustPlatform.buildRustPackage rec { }; cargoHash = "sha256-W6HkLCUoylgQQc2fFprmJeLH8KtpVUD4+BXWbNECVZ4="; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { package = commitlint-rs; }; }; meta = with lib; { diff --git a/pkgs/by-name/co/commitmsgfmt/package.nix b/pkgs/by-name/co/commitmsgfmt/package.nix index e653fce2671a73d..9a84e834fa2e66a 100644 --- a/pkgs/by-name/co/commitmsgfmt/package.nix +++ b/pkgs/by-name/co/commitmsgfmt/package.nix @@ -1,8 +1,7 @@ { lib , rustPlatform , fetchFromGitLab -, testers -, commitmsgfmt +, versionCheckHook }: rustPlatform.buildRustPackage rec { pname = "commitmsgfmt"; @@ -16,10 +15,10 @@ rustPlatform.buildRustPackage rec { }; cargoHash = "sha256-jTRB9ogFQGVC4C9xpGxsJYV3cnWydAJLMcjhzUPULTE="; - passthru.tests.version = testers.testVersion { - package = commitmsgfmt; - command = "commitmsgfmt -V"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "-V"; meta = with lib; { homepage = "https://gitlab.com/mkjeldsen/commitmsgfmt"; diff --git a/pkgs/by-name/co/committed/package.nix b/pkgs/by-name/co/committed/package.nix index cd42172fde9f79e..d06230803e097c8 100644 --- a/pkgs/by-name/co/committed/package.nix +++ b/pkgs/by-name/co/committed/package.nix @@ -3,9 +3,8 @@ , fetchFromGitHub , rustPlatform , darwin -, testers , nix-update-script -, committed +, versionCheckHook }: let version = "1.0.20"; @@ -24,8 +23,10 @@ rustPlatform.buildRustPackage { buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { package = committed; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/co/corrscope/package.nix b/pkgs/by-name/co/corrscope/package.nix index 0148ab90eb078d7..fee19a7d6ddd4b4 100644 --- a/pkgs/by-name/co/corrscope/package.nix +++ b/pkgs/by-name/co/corrscope/package.nix @@ -4,8 +4,7 @@ , fetchFromGitHub , ffmpeg , libsForQt5 -, testers -, corrscope +, versionCheckHook }: python3Packages.buildPythonApplication rec { @@ -60,13 +59,16 @@ python3Packages.buildPythonApplication rec { ) ''; - passthru.tests.version = testers.testVersion { - package = corrscope; - # Tries writing to - # - $HOME/.local/share/corrscope on Linux - # - $HOME/Library/Application Support/corrscope on Darwin - command = "env HOME=$TMPDIR ${lib.getExe corrscope} --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "corr"; + # Tries writing to + # - $HOME/.local/share/corrscope on Linux + # - $HOME/Library/Application Support/corrscope on Darwin + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; meta = with lib; { description = "Render wave files into oscilloscope views, featuring advanced correlation-based triggering algorithm"; diff --git a/pkgs/by-name/cr/crc/package.nix b/pkgs/by-name/cr/crc/package.nix index 18f9b852a24396d..db33437db4a837d 100644 --- a/pkgs/by-name/cr/crc/package.nix +++ b/pkgs/by-name/cr/crc/package.nix @@ -1,9 +1,8 @@ { lib , buildGoModule , fetchFromGitHub -, testers -, crc , coreutils +, versionCheckHook }: let @@ -53,13 +52,14 @@ buildGoModule rec { export HOME=$(mktemp -d) ''; - passthru.tests.version = testers.testVersion { - package = crc; - command = '' - export HOME=$(mktemp -d) - crc version - ''; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; + versionCheckProgramArg = "version"; + passthru.updateScript = ./update.sh; meta = with lib; { diff --git a/pkgs/by-name/cr/cringify/package.nix b/pkgs/by-name/cr/cringify/package.nix index f9e4bc2f9050039..b7599fa1f014337 100644 --- a/pkgs/by-name/cr/cringify/package.nix +++ b/pkgs/by-name/cr/cringify/package.nix @@ -2,8 +2,7 @@ , rustPlatform , fetchFromGitHub , python3 -, testers -, cringify +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -29,7 +28,8 @@ rustPlatform.buildRustPackage rec { # No tests are present in the repository doCheck = false; - passthru.tests.version = testers.testVersion { package = cringify; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Annoy your friends with the cringified text"; diff --git a/pkgs/by-name/cr/criterion/package.nix b/pkgs/by-name/cr/criterion/package.nix index 1b48227dcb33b57..2cae17fcf51ed32 100644 --- a/pkgs/by-name/cr/criterion/package.nix +++ b/pkgs/by-name/cr/criterion/package.nix @@ -94,6 +94,7 @@ stdenv.mkDerivation rec { ]; passthru.tests.version = + # TODO: Use `versionCheckHook` let tester = callPackage ./tests/001-version.nix {}; in diff --git a/pkgs/by-name/cr/crossplane-cli/package.nix b/pkgs/by-name/cr/crossplane-cli/package.nix index 9fc066de866c6b7..37702ec0ee55a76 100644 --- a/pkgs/by-name/cr/crossplane-cli/package.nix +++ b/pkgs/by-name/cr/crossplane-cli/package.nix @@ -2,8 +2,7 @@ , buildGoModule , fetchFromGitHub , nix-update-script -, testers -, crossplane-cli +, versionCheckHook }: buildGoModule rec { @@ -31,11 +30,11 @@ buildGoModule rec { mv $out/bin/crank $out/bin/crossplane ''; - passthru.tests.version = testers.testVersion { - package = crossplane-cli; - command = "crossplane version || true"; - version = "v${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/crossplane"; + versionCheckProgramArg = "version"; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/cs/csvq/package.nix b/pkgs/by-name/cs/csvq/package.nix index 050b25f8da58b28..4e922da078e305f 100644 --- a/pkgs/by-name/cs/csvq/package.nix +++ b/pkgs/by-name/cs/csvq/package.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, testers, lib, csvq }: +{ buildGoModule, fetchFromGitHub, lib, versionCheckHook }: buildGoModule rec { pname = "csvq"; @@ -13,10 +13,8 @@ buildGoModule rec { vendorHash = "sha256-byBYp+iNnnsAXR+T3XmdwaeeBG8oB1EgNkDabzgUC98="; - passthru.tests.version = testers.testVersion { - package = csvq; - version = "csvq version ${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "SQL-like query language for CSV"; diff --git a/pkgs/by-name/cu/cue/package.nix b/pkgs/by-name/cu/cue/package.nix index b2f8359419e0d50..196cb4f49f9f086 100644 --- a/pkgs/by-name/cu/cue/package.nix +++ b/pkgs/by-name/cu/cue/package.nix @@ -2,8 +2,7 @@ , fetchFromGitHub , lib , installShellFiles -, testers -, cue +, versionCheckHook , callPackage }: @@ -37,15 +36,15 @@ buildGoModule rec { --zsh <($out/bin/cue completion zsh) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + passthru = { writeCueValidator = callPackage ./validator.nix { }; tests = { test-001-all-good = callPackage ./tests/001-all-good.nix { }; - version = testers.testVersion { - package = cue; - command = "cue version"; - version = "v${version}"; - }; }; }; diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index 5bdeaf1c9c18e42..dec0d06e1758599 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -7,8 +7,7 @@ , darwin , libusb1 , nix-update-script -, testers -, cyme +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -42,11 +41,11 @@ rustPlatform.buildRustPackage rec { "--skip=test_run" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - package = cyme; - }; }; meta = with lib; { diff --git a/pkgs/by-name/cz/czkawka/package.nix b/pkgs/by-name/cz/czkawka/package.nix index ca21fc82c875557..ce5a070270f1d63 100644 --- a/pkgs/by-name/cz/czkawka/package.nix +++ b/pkgs/by-name/cz/czkawka/package.nix @@ -2,7 +2,6 @@ , stdenv , atk , cairo -, czkawka , darwin , fetchFromGitHub , gdk-pixbuf @@ -13,7 +12,7 @@ , overrideSDK , pkg-config , rustPlatform -, testers +, versionCheckHook , wrapGAppsHook4 , xvfb-run }: @@ -70,10 +69,10 @@ buildRustPackage' { doCheck = stdenv.hostPlatform.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform); - passthru.tests.version = testers.testVersion { - package = czkawka; - command = "czkawka_cli --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "czkawka_cli"; # Desktop items, icons and metainfo are not installed automatically postInstall = '' diff --git a/pkgs/by-name/da/dart-sass/package.nix b/pkgs/by-name/da/dart-sass/package.nix index 579f96ce9b0f38d..c704c130836e22d 100644 --- a/pkgs/by-name/da/dart-sass/package.nix +++ b/pkgs/by-name/da/dart-sass/package.nix @@ -7,6 +7,7 @@ testers, dart-sass, runCommand, + versionCheckHook, writeText, }: @@ -46,15 +47,13 @@ buildDartApplication rec { dartCompileFlags = [ "--define=version=${version}" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { inherit embedded-protocol-version embedded-protocol; updateScript = ./update.sh; tests = { - version = testers.testVersion { - package = dart-sass; - command = "dart-sass --version"; - }; - simple = testers.testEqualContents { assertion = "dart-sass compiles a basic scss file"; expected = writeText "expected" '' diff --git a/pkgs/by-name/de/dependabot-cli/package.nix b/pkgs/by-name/de/dependabot-cli/package.nix index 98bcbf46e66304b..fafb3d3d4fff036 100644 --- a/pkgs/by-name/de/dependabot-cli/package.nix +++ b/pkgs/by-name/de/dependabot-cli/package.nix @@ -1,9 +1,8 @@ { buildGoModule -, dependabot-cli , fetchFromGitHub , installShellFiles , lib -, testers +, versionCheckHook }: let pname = "dependabot-cli"; @@ -40,16 +39,10 @@ buildGoModule { "-skip=TestIntegration|TestNewProxy_customCert|TestRun" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; - installCheckPhase = '' - $out/bin/dependabot --help - ''; - passthru.tests.version = testers.testVersion { - package = dependabot-cli; - command = "dependabot --version"; - version = "v${version}"; - }; + versionCheckProgram = "dependabot"; meta = with lib; { changelog = "https://github.com/dependabot/cli/releases/tag/v${version}"; diff --git a/pkgs/by-name/de/devenv/package.nix b/pkgs/by-name/de/devenv/package.nix index 8a39f5715ae14d7..eba12d96a48eb66 100644 --- a/pkgs/by-name/de/devenv/package.nix +++ b/pkgs/by-name/de/devenv/package.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , makeWrapper , rustPlatform -, testers +, versionCheckHook , cachix , darwin @@ -11,8 +11,6 @@ , nix , openssl , pkg-config - -, devenv # required to run version test }: let @@ -53,12 +51,12 @@ in rustPlatform.buildRustPackage { wrapProgram $out/bin/devenv --set DEVENV_NIX ${devenv_nix} --prefix PATH ":" "$out/bin:${cachix}/bin" ''; - passthru.tests = { - version = testers.testVersion { - package = devenv; - command = "export XDG_DATA_HOME=$PWD; devenv version"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export XDG_DATA_HOME=$(mktemp -d) + ''; meta = { changelog = "https://github.com/cachix/devenv/releases/tag/v${version}"; diff --git a/pkgs/by-name/di/diesel-cli/package.nix b/pkgs/by-name/di/diesel-cli/package.nix index 0349ec8ac84daaa..8d439ca6883295c 100644 --- a/pkgs/by-name/di/diesel-cli/package.nix +++ b/pkgs/by-name/di/diesel-cli/package.nix @@ -12,9 +12,8 @@ pkg-config, postgresql, sqlite, - testers, + versionCheckHook, zlib, - diesel-cli, sqliteSupport ? true, postgresqlSupport ? true, mysqlSupport ? true, @@ -53,6 +52,9 @@ rustPlatform.buildRustPackage rec { zlib ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + buildNoDefaultFeatures = true; buildFeatures = lib.optional sqliteSupport "sqlite" @@ -87,8 +89,9 @@ rustPlatform.buildRustPackage rec { # DSO missing from command line" errors for libz and libssl. env.NIX_LDFLAGS = lib.optionalString mysqlSupport "-lz -lssl -lcrypto"; + versionCheckProgram = "${placeholder "out"}/bin/diesel"; + passthru = { - tests.version = testers.testVersion { package = diesel-cli; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/di/diffedit3/package.nix b/pkgs/by-name/di/diffedit3/package.nix index 6e1edaf882fa437..d5525dd8d7f101b 100644 --- a/pkgs/by-name/di/diffedit3/package.nix +++ b/pkgs/by-name/di/diffedit3/package.nix @@ -1,5 +1,5 @@ { lib, rustPlatform, fetchCrate -, testers, nix-update-script, diffedit3 +, nix-update-script, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -13,11 +13,11 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-e5bm8GLubA9BzH9oKKSC/Ysh+O+GJA8x6W576vKIIUA="; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests = testers.testVersion { - package = diffedit3; - }; }; meta = with lib; { diff --git a/pkgs/by-name/di/discordchatexporter-cli/package.nix b/pkgs/by-name/di/discordchatexporter-cli/package.nix index 157571269688ed0..cdd9761e32cd6eb 100644 --- a/pkgs/by-name/di/discordchatexporter-cli/package.nix +++ b/pkgs/by-name/di/discordchatexporter-cli/package.nix @@ -2,8 +2,7 @@ , buildDotnetModule , dotnetCorePackages , fetchFromGitHub -, testers -, discordchatexporter-cli +, versionCheckHook }: buildDotnetModule rec { @@ -26,12 +25,11 @@ buildDotnetModule rec { ln -s $out/bin/DiscordChatExporter.Cli $out/bin/discordchatexporter-cli ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = ./updater.sh; - tests.version = testers.testVersion { - package = discordchatexporter-cli; - version = "v${version}"; - }; }; meta = with lib; { diff --git a/pkgs/by-name/di/distribution/package.nix b/pkgs/by-name/di/distribution/package.nix index 9da917b512180be..4244073fae80047 100644 --- a/pkgs/by-name/di/distribution/package.nix +++ b/pkgs/by-name/di/distribution/package.nix @@ -3,8 +3,7 @@ , fetchFromGitHub , fetchpatch , nix-update-script -, testers -, distribution +, versionCheckHook }: buildGoModule rec { @@ -41,11 +40,12 @@ buildGoModule rec { "-skip=^TestHTTPChecker$|^TestInMemoryDriverSuite$" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/registry"; + passthru = { - tests.version = testers.testVersion { - package = distribution; - version = "v${version}"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/dm/dmalloc/package.nix b/pkgs/by-name/dm/dmalloc/package.nix index a92761f749cc877..98da00b7e756fcc 100644 --- a/pkgs/by-name/dm/dmalloc/package.nix +++ b/pkgs/by-name/dm/dmalloc/package.nix @@ -1,8 +1,7 @@ { lib , stdenv , fetchFromGitHub -, testers -, dmalloc +, versionCheckHook }: stdenv.mkDerivation rec { @@ -22,9 +21,8 @@ stdenv.mkDerivation rec { "--enable-threads" ]; - passthru.tests.version = testers.testVersion { - package = dmalloc; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Debug Malloc memory allocation debugging C library"; diff --git a/pkgs/by-name/do/docfd/package.nix b/pkgs/by-name/do/docfd/package.nix index 3636296b8de44a8..df6346cd2ad00d3 100644 --- a/pkgs/by-name/do/docfd/package.nix +++ b/pkgs/by-name/do/docfd/package.nix @@ -9,8 +9,7 @@ makeWrapper, pandoc, poppler_utils, - testers, - docfd, + versionCheckHook, }: let @@ -66,7 +65,8 @@ buildDunePackage' rec { }" ''; - passthru.tests.version = testers.testVersion { package = docfd; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "TUI multiline fuzzy document finder"; diff --git a/pkgs/by-name/do/docker-credential-gcr/package.nix b/pkgs/by-name/do/docker-credential-gcr/package.nix index 620cce774374357..40af31395c3885b 100644 --- a/pkgs/by-name/do/docker-credential-gcr/package.nix +++ b/pkgs/by-name/do/docker-credential-gcr/package.nix @@ -1,10 +1,9 @@ { buildGoModule, - docker-credential-gcr, fetchFromGitHub, lib, nix-update-script, - testers, + versionCheckHook, }: buildGoModule rec { @@ -32,11 +31,12 @@ buildGoModule rec { "-X github.com/GoogleCloudPlatform/docker-credential-gcr/v2/config.Version=${version}" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + passthru = { - tests.version = testers.testVersion { - package = docker-credential-gcr; - command = "docker-credential-gcr version"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/do/dooit/package.nix b/pkgs/by-name/do/dooit/package.nix index ea549fff71962ac..6c1dbd80f19701e 100644 --- a/pkgs/by-name/do/dooit/package.nix +++ b/pkgs/by-name/do/dooit/package.nix @@ -1,9 +1,8 @@ { lib , fetchFromGitHub -, dooit , python3 -, testers , nix-update-script +, versionCheckHook }: python3.pkgs.buildPythonApplication rec { @@ -39,12 +38,14 @@ python3.pkgs.buildPythonApplication rec { # No tests available doCheck = false; - passthru = { - tests.version = testers.testVersion { - package = dooit; - command = "HOME=$(mktemp -d) dooit --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; + passthru = { updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/do/doppler/package.nix b/pkgs/by-name/do/doppler/package.nix index 29537bcb9abb39b..b39d5387452a47f 100644 --- a/pkgs/by-name/do/doppler/package.nix +++ b/pkgs/by-name/do/doppler/package.nix @@ -1,9 +1,8 @@ { buildGoModule -, doppler , fetchFromGitHub , installShellFiles , lib -, testers +, versionCheckHook }: buildGoModule rec { @@ -34,10 +33,8 @@ buildGoModule rec { --zsh <($out/bin/doppler completion zsh) ''; - passthru.tests.version = testers.testVersion { - package = doppler; - version = "v${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Official CLI for interacting with your Doppler Enclave secrets and configuration"; diff --git a/pkgs/by-name/do/dosbox-staging/package.nix b/pkgs/by-name/do/dosbox-staging/package.nix index f4cab21b1b3054d..ba746987bc40b93 100644 --- a/pkgs/by-name/do/dosbox-staging/package.nix +++ b/pkgs/by-name/do/dosbox-staging/package.nix @@ -28,7 +28,7 @@ pkg-config, speexdsp, stdenv, - testers, + versionCheckHook, zlib-ng, }: @@ -109,13 +109,12 @@ stdenv.mkDerivation (finalAttrs: { popd ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/dosbox"; + passthru = { - tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "dosbox --version"; - }; - }; updateScript = gitUpdater { rev-prefix = "v"; }; diff --git a/pkgs/by-name/do/dotenvx/package.nix b/pkgs/by-name/do/dotenvx/package.nix index b90e659b703f0b3..98ef38cc223436c 100644 --- a/pkgs/by-name/do/dotenvx/package.nix +++ b/pkgs/by-name/do/dotenvx/package.nix @@ -2,8 +2,7 @@ lib, buildNpmPackage, fetchFromGitHub, - testers, - dotenvx, + versionCheckHook, }: buildNpmPackage rec { @@ -21,13 +20,12 @@ buildNpmPackage rec { dontNpmBuild = true; - passthru.tests = { - version = testers.testVersion { - package = dotenvx; - # access to the home directory - command = "HOME=$TMPDIR dotenvx --version"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; meta = { description = "Better dotenv–from the creator of `dotenv"; diff --git a/pkgs/by-name/do/dotslash/package.nix b/pkgs/by-name/do/dotslash/package.nix index 90bfc0a7b7a1e8d..1f53a27b18ca702 100644 --- a/pkgs/by-name/do/dotslash/package.nix +++ b/pkgs/by-name/do/dotslash/package.nix @@ -1,5 +1,5 @@ { lib, rustPlatform, fetchCrate -, testers, nix-update-script, dotslash +, nix-update-script, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -14,11 +14,11 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-URZ6HfyfY2Fh4iVMoG4OkQFFuLIRV7s5hlZLUFzeUvA="; doCheck = false; # http tests + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests = testers.testVersion { - package = dotslash; - }; }; meta = with lib; { diff --git a/pkgs/by-name/du/dualsensectl/package.nix b/pkgs/by-name/du/dualsensectl/package.nix index 63eefab713dc661..530b3b7b088b425 100644 --- a/pkgs/by-name/du/dualsensectl/package.nix +++ b/pkgs/by-name/du/dualsensectl/package.nix @@ -6,7 +6,7 @@ dbus, hidapi, udev, - testers, + versionCheckHook, nix-update-script, }: @@ -35,8 +35,10 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "DESTDIR=$(out)" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/du/dunst/package.nix b/pkgs/by-name/du/dunst/package.nix index f01f65c8628315a..0a2bc9be42e818e 100644 --- a/pkgs/by-name/du/dunst/package.nix +++ b/pkgs/by-name/du/dunst/package.nix @@ -22,8 +22,7 @@ , pango , xorgproto , librsvg -, testers -, dunst +, versionCheckHook , withX11 ? true , withWayland ? true }: @@ -89,7 +88,8 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "jq" "${lib.getExe jq}" ''; - passthru.tests.version = testers.testVersion { package = dunst; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Lightweight and customizable notification daemon"; diff --git a/pkgs/by-name/dy/dynamodb-local/package.nix b/pkgs/by-name/dy/dynamodb-local/package.nix index 55258e1fe3fa22b..118595da9d5b560 100644 --- a/pkgs/by-name/dy/dynamodb-local/package.nix +++ b/pkgs/by-name/dy/dynamodb-local/package.nix @@ -7,9 +7,8 @@ , curl , jq , yq -, dynamodb-local -, testers , common-updater-scripts +, versionCheckHook , writeShellScript }: let @@ -49,10 +48,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { - package = dynamodb-local; - }; updateScript = writeShellScript "update-dynamodb-local" '' set -o errexit export PATH="${lib.makeBinPath [ curl jq yq common-updater-scripts ]}:$PATH" diff --git a/pkgs/by-name/ej/ejsonkms/package.nix b/pkgs/by-name/ej/ejsonkms/package.nix index 7c73565e61022dc..aefebe65ecc7d26 100644 --- a/pkgs/by-name/ej/ejsonkms/package.nix +++ b/pkgs/by-name/ej/ejsonkms/package.nix @@ -2,8 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - testers, - ejsonkms, + versionCheckHook }: buildGoModule rec { @@ -25,12 +24,8 @@ buildGoModule rec { doCheck = false; - passthru.tests = { - version = testers.testVersion { - package = ejsonkms; - version = "v${version}"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Integrates EJSON with AWS KMS"; diff --git a/pkgs/by-name/el/elasticsearch-curator/package.nix b/pkgs/by-name/el/elasticsearch-curator/package.nix index 6a142aeb1ac5bec..191843b4a750e92 100644 --- a/pkgs/by-name/el/elasticsearch-curator/package.nix +++ b/pkgs/by-name/el/elasticsearch-curator/package.nix @@ -1,10 +1,9 @@ { lib, - elasticsearch-curator, fetchFromGitHub, nix-update-script, python3, - testers, + versionCheckHook, }: python3.pkgs.buildPythonApplication rec { @@ -68,11 +67,11 @@ python3.pkgs.buildPythonApplication rec { "test_api_key_set" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + + versionCheckProgram = "${placeholder "out"}/bin/curator"; + passthru = { - tests.version = testers.testVersion { - package = elasticsearch-curator; - command = "${lib.getExe elasticsearch-curator} --version"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ev/evdevhook2/package.nix b/pkgs/by-name/ev/evdevhook2/package.nix index 9e57517bd5d274d..a0010377bf1dc26 100644 --- a/pkgs/by-name/ev/evdevhook2/package.nix +++ b/pkgs/by-name/ev/evdevhook2/package.nix @@ -10,7 +10,7 @@ libevdev, libgee, udev, - testers, + versionCheckHook, nix-update-script, }: @@ -56,12 +56,10 @@ stdenv.mkDerivation (finalAttrs: { mesonBuildType = "release"; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "Evdevhook ${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/fa/facter/package.nix b/pkgs/by-name/fa/facter/package.nix index fa92def6b1bc280..8dd303162ece55f 100644 --- a/pkgs/by-name/fa/facter/package.nix +++ b/pkgs/by-name/fa/facter/package.nix @@ -46,6 +46,7 @@ bundlerApp { ''; passthru = { + # TODO: use `versionCheckHook` tests.version = testers.testVersion { command = "${lib.getExe facter} --version"; package = facter; diff --git a/pkgs/by-name/fa/fastfetch/package.nix b/pkgs/by-name/fa/fastfetch/package.nix index d4a64e36ff747c5..0ba850fa35b28ae 100644 --- a/pkgs/by-name/fa/fastfetch/package.nix +++ b/pkgs/by-name/fa/fastfetch/package.nix @@ -29,8 +29,8 @@ , python3 , rpm , sqlite -, testers , util-linux +, versionCheckHook , vulkan-loader , wayland , xfce @@ -118,6 +118,9 @@ stdenv'.mkDerivation (finalAttrs: { darwin.moltenvk ]); + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + cmakeFlags = [ (lib.cmakeOptionType "filepath" "CMAKE_INSTALL_SYSCONFDIR" "${placeholder "out"}/etc") (lib.cmakeBool "ENABLE_DIRECTX_HEADERS" false) @@ -152,11 +155,6 @@ stdenv'.mkDerivation (finalAttrs: { passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "fastfetch -v | cut -d '(' -f 1"; - version = "fastfetch ${finalAttrs.version}"; - }; }; meta = { diff --git a/pkgs/by-name/fa/fastqc/package.nix b/pkgs/by-name/fa/fastqc/package.nix index e7973ab0d602cc5..c5a301bd1c81cf9 100644 --- a/pkgs/by-name/fa/fastqc/package.nix +++ b/pkgs/by-name/fa/fastqc/package.nix @@ -8,7 +8,7 @@ makeDesktopItem, copyDesktopItems, desktopToDarwinBundle, - testers + versionCheckHook, }: stdenv.mkDerivation (finalAttrs: { @@ -55,10 +55,8 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper $out/FastQC/fastqc $out/bin/fastqc --prefix PATH : ${jre}/bin ''; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "A quality control application for high throughput sequence data"; diff --git a/pkgs/by-name/fe/feather/package.nix b/pkgs/by-name/fe/feather/package.nix index 6ef42e918f343f0..3878903e1f88a0a 100644 --- a/pkgs/by-name/fe/feather/package.nix +++ b/pkgs/by-name/fe/feather/package.nix @@ -14,9 +14,9 @@ , qt6 , readline , stdenv -, testers , tor , unbound +, versionCheckHook , zxing-cpp }: @@ -69,12 +69,12 @@ stdenv.mkDerivation (finalAttrs: { "-DTOR_VERSION=${tor.version}" ]; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - command = '' - QT_QPA_PLATFORM=minimal ${finalAttrs.finalPackage.meta.mainProgram} --version - ''; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export QT_QPA_PLATFORM=minimal + ''; meta = with lib; { description = "Free Monero desktop wallet"; diff --git a/pkgs/by-name/fi/files-cli/package.nix b/pkgs/by-name/fi/files-cli/package.nix index 1058756179de9fb..77b4246381cbe5f 100644 --- a/pkgs/by-name/fi/files-cli/package.nix +++ b/pkgs/by-name/fi/files-cli/package.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub , buildGoModule -, testers -, files-cli +, versionCheckHook }: buildGoModule rec { @@ -24,23 +23,10 @@ buildGoModule rec { "-X main.version=${version}" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - - $out/bin/files-cli --help - - runHook postInstallCheck - ''; - - passthru.tests = { - version = testers.testVersion { - package = files-cli; - command = "files-cli -v"; - version = "files-cli version ${version}"; - }; - }; + versionCheckProgramArg = "-v"; meta = with lib; { description = "Files.com Command Line App for Windows, Linux, and macOS"; diff --git a/pkgs/by-name/fl/flatpak/package.nix b/pkgs/by-name/fl/flatpak/package.nix index fc109bf508345a2..1962b930483404f 100644 --- a/pkgs/by-name/fl/flatpak/package.nix +++ b/pkgs/by-name/fl/flatpak/package.nix @@ -45,8 +45,8 @@ socat, substituteAll, systemd, - testers, valgrind, + versionCheckHook, which, wrapGAppsNoGuiHook, xdg-dbus-proxy, @@ -170,6 +170,9 @@ stdenv.mkDerivation (finalAttrs: { # TODO: some issues with temporary files doCheck = false; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + NIX_LDFLAGS = "-lpthread"; enableParallelBuilding = true; @@ -219,8 +222,6 @@ stdenv.mkDerivation (finalAttrs: { grep format=svg "$out" ''; - - version = testers.testVersion { package = finalAttrs.finalPackage; }; }; }; diff --git a/pkgs/by-name/fl/flite/package.nix b/pkgs/by-name/fl/flite/package.nix index f39e1257185a82f..f1963cf19cf85f3 100644 --- a/pkgs/by-name/fl/flite/package.nix +++ b/pkgs/by-name/fl/flite/package.nix @@ -5,7 +5,7 @@ fetchpatch, alsa-lib, libpulseaudio, - testers, + versionCheckHook, audioBackend ? "pulseaudio", }: assert lib.assertOneOf "audioBackend" audioBackend [ @@ -48,6 +48,9 @@ stdenv.mkDerivation (finalAttrs: { .${audioBackend} or (throw "${audioBackend} is not a supported backend!") ); + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + configureFlags = [ "--enable-shared" ] ++ lib.optionals stdenv.isLinux [ "--with-audio=${audioBackend}" ]; @@ -56,14 +59,6 @@ stdenv.mkDerivation (finalAttrs: { # make[1]: *** No rule to make target 'flite_voice_list.c', needed by 'all'. Stop enableParallelBuilding = false; - passthru = { - tests.version = testers.testVersion { - # `flite` does have a `--version` command, but it returns 1 - command = "flite --help"; - package = finalAttrs.finalPackage; - }; - }; - meta = { description = "Small, fast run-time speech synthesis engine"; homepage = "http://www.festvox.org/flite/"; diff --git a/pkgs/by-name/fo/forgejo-runner/package.nix b/pkgs/by-name/fo/forgejo-runner/package.nix index 77027eed675ec5f..833209661fd757c 100644 --- a/pkgs/by-name/fo/forgejo-runner/package.nix +++ b/pkgs/by-name/fo/forgejo-runner/package.nix @@ -1,9 +1,8 @@ { lib , buildGoModule , fetchFromGitea -, testers -, forgejo-runner , nixosTests +, versionCheckHook }: buildGoModule rec { @@ -28,12 +27,13 @@ buildGoModule rec { doCheck = false; # Test try to lookup code.forgejo.org. + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "act_runner"; + passthru.tests = { inherit (nixosTests.forgejo) sqlite3; - version = testers.testVersion { - package = forgejo-runner; - version = src.rev; - }; }; meta = with lib; { diff --git a/pkgs/by-name/fr/frankenphp/package.nix b/pkgs/by-name/fr/frankenphp/package.nix index a373c870c546bf2..4836cf0b99126b3 100644 --- a/pkgs/by-name/fr/frankenphp/package.nix +++ b/pkgs/by-name/fr/frankenphp/package.nix @@ -4,13 +4,13 @@ , fetchFromGitHub , php , brotli -, testers , frankenphp , darwin , libiconv , pkg-config , makeBinaryWrapper , runCommand +, versionCheckHook , writeText }: @@ -77,15 +77,15 @@ in buildGoModule rec { doCheck = false; + # TODO: real NixOS test with Symfony application + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + passthru = { php = phpEmbedWithZts; tests = { - # TODO: real NixOS test with Symfony application - version = testers.testVersion { - inherit version; - package = frankenphp; - command = "frankenphp version"; - }; phpinfo = runCommand "php-cli-phpinfo" { phpScript = writeText "phpinfo.php" '' mods.1 diff --git a/pkgs/by-name/mo/mold/package.nix b/pkgs/by-name/mo/mold/package.nix index 1c57db66fb65099..6dd5a7596c00023 100644 --- a/pkgs/by-name/mo/mold/package.nix +++ b/pkgs/by-name/mo/mold/package.nix @@ -14,10 +14,9 @@ , clangStdenv , gccStdenv , hello -, mold , mold-wrapped , runCommandCC -, testers +, versionCheckHook , useMoldLinker }: @@ -54,6 +53,9 @@ stdenv.mkDerivation rec { "-faligned-allocation" ]); + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; tests = @@ -88,10 +90,7 @@ stdenv.mkDerivation rec { fi '' ; - in - { - version = testers.testVersion { package = mold; }; - } // lib.optionalAttrs stdenv.isLinux { + in lib.optionalAttrs stdenv.isLinux { adapter-gcc = helloTest "adapter-gcc" (hello.override (old: { stdenv = useMoldLinker gccStdenv; })); adapter-llvm = helloTest "adapter-llvm" (hello.override (old: { stdenv = useMoldLinker clangStdenv; })); wrapped = helloTest "wrapped" (hello.overrideAttrs (previousAttrs: { diff --git a/pkgs/by-name/mo/mosdepth/package.nix b/pkgs/by-name/mo/mosdepth/package.nix index da7f210ecf57fb9..fad7e6219dddc07 100644 --- a/pkgs/by-name/mo/mosdepth/package.nix +++ b/pkgs/by-name/mo/mosdepth/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNimPackage, fetchFromGitHub, pcre, testers }: +{ lib, buildNimPackage, fetchFromGitHub, pcre, versionCheckHook }: buildNimPackage (finalAttrs: { pname = "mosdepth"; @@ -17,11 +17,8 @@ buildNimPackage (finalAttrs: { buildInputs = [ pcre ]; - passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing"; diff --git a/pkgs/by-name/mo/mosdns/package.nix b/pkgs/by-name/mo/mosdns/package.nix index e38eea0285512e1..6574ec04bf436a3 100644 --- a/pkgs/by-name/mo/mosdns/package.nix +++ b/pkgs/by-name/mo/mosdns/package.nix @@ -2,10 +2,9 @@ lib, buildGoModule, fetchFromGitHub, - testers, - mosdns, stdenv, installShellFiles, + versionCheckHook, }: buildGoModule rec { @@ -36,12 +35,8 @@ buildGoModule rec { --zsh <($out/bin/mosdns completion zsh) ''; - passthru.tests = { - version = testers.testVersion { - package = mosdns; - command = "${lib.getExe mosdns} version"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Modular, pluggable DNS forwarder"; diff --git a/pkgs/by-name/mp/mpack/package.nix b/pkgs/by-name/mp/mpack/package.nix index d428fbe664c9265..a047aeaa50b9e59 100644 --- a/pkgs/by-name/mp/mpack/package.nix +++ b/pkgs/by-name/mp/mpack/package.nix @@ -2,8 +2,7 @@ lib, stdenv, fetchurl, - testers, - mpack, + versionCheckHook, }: stdenv.mkDerivation rec { @@ -38,15 +37,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - passthru.tests = { - version = testers.testVersion { - command = '' - mpack 2>&1 || echo "mpack exited with error code $?" - ''; - package = mpack; - version = "mpack version ${version}"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = ""; meta = with lib; { description = "Utilities for encoding and decoding binary files in MIME"; diff --git a/pkgs/by-name/my/myks/package.nix b/pkgs/by-name/my/myks/package.nix index e83e8de1aeb9593..a171d0e0a30234e 100644 --- a/pkgs/by-name/my/myks/package.nix +++ b/pkgs/by-name/my/myks/package.nix @@ -1,10 +1,9 @@ { lib, buildGoModule, fetchFromGitHub, - testers, installShellFiles, - myks, stdenv, + versionCheckHook, }: buildGoModule rec { @@ -34,8 +33,6 @@ buildGoModule rec { CGO_ENABLED = 0; - passthru.tests.version = testers.testVersion { package = myks; }; - postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd myks \ @@ -44,6 +41,9 @@ buildGoModule rec { --fish <($out/bin/myks completion fish) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + meta = with lib; { changelog = "https://github.com/mykso/myks/blob/v${version}/CHANGELOG.md"; description = "Configuration framework for Kubernetes applications"; diff --git a/pkgs/by-name/my/mystmd/package.nix b/pkgs/by-name/my/mystmd/package.nix index c1a95ca0b51c969..f7fb8cefb32d5cc 100644 --- a/pkgs/by-name/my/mystmd/package.nix +++ b/pkgs/by-name/my/mystmd/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNpmPackage, fetchFromGitHub, mystmd, testers, nix-update-script }: +{ lib, buildNpmPackage, fetchFromGitHub, nix-update-script, versionCheckHook }: buildNpmPackage rec { pname = "mystmd"; @@ -23,11 +23,12 @@ buildNpmPackage rec { runHook postInstall ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/myst"; + passthru = { - tests.version = testers.testVersion { - package = mystmd; - version = "v${version}"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/nb/nb-cli/package.nix b/pkgs/by-name/nb/nb-cli/package.nix index 5362c16e3ae2a06..0d3a8b60638b61f 100644 --- a/pkgs/by-name/nb/nb-cli/package.nix +++ b/pkgs/by-name/nb/nb-cli/package.nix @@ -1,9 +1,8 @@ { fetchPypi, lib, - nb-cli, python3, - testers, + versionCheckHook, }: python3.pkgs.buildPythonApplication rec { @@ -40,14 +39,14 @@ python3.pkgs.buildPythonApplication rec { wcwidth ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + # no test doCheck = false; pythonImportsCheck = [ "nb_cli" ]; - passthru.tests = { - version = testers.testVersion { package = nb-cli; }; - }; + versionCheckProgram = "nb"; meta = { description = "CLI for nonebot2"; diff --git a/pkgs/by-name/ne/nezha-agent/package.nix b/pkgs/by-name/ne/nezha-agent/package.nix index 0c50dc4ecef2ddd..d9653302374fea4 100644 --- a/pkgs/by-name/ne/nezha-agent/package.nix +++ b/pkgs/by-name/ne/nezha-agent/package.nix @@ -2,8 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - nezha-agent, - testers, + versionCheckHook, }: buildGoModule rec { pname = "nezha-agent"; @@ -29,12 +28,11 @@ buildGoModule rec { rm ./pkg/monitor/myip_test.go ''; - passthru.tests = { - version = testers.testVersion { - package = nezha-agent; - command = "${nezha-agent}/bin/agent -v"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/agent"; + versionCheckProgramArg = "-v"; meta = { description = "Agent of Nezha Monitoring"; diff --git a/pkgs/by-name/nf/nf-test/package.nix b/pkgs/by-name/nf/nf-test/package.nix index 44a6c5d8f4a9816..bbc348c417a872b 100644 --- a/pkgs/by-name/nf/nf-test/package.nix +++ b/pkgs/by-name/nf/nf-test/package.nix @@ -2,10 +2,9 @@ , fetchurl , makeWrapper , nextflow -, nf-test , openjdk11 , stdenv -, testers +, versionCheckHook }: stdenv.mkDerivation rec { @@ -41,10 +40,10 @@ stdenv.mkDerivation rec { runHook postInstall ''; - passthru.tests.version = testers.testVersion { - package = nf-test; - command = "nf-test version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; meta = with lib; { description = "Simple test framework for Nextflow pipelines"; diff --git a/pkgs/by-name/ni/nimdow/package.nix b/pkgs/by-name/ni/nimdow/package.nix index d35436b18481fc1..9bb047fa0eb0397 100644 --- a/pkgs/by-name/ni/nimdow/package.nix +++ b/pkgs/by-name/ni/nimdow/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNimPackage, fetchFromGitHub, nixosTests, testers }: +{ lib, buildNimPackage, fetchFromGitHub, nixosTests, versionCheckHook }: buildNimPackage (finalAttrs: { pname = "nimdow"; @@ -27,12 +27,11 @@ buildNimPackage (finalAttrs: { substituteInPlace src/nimdowpkg/config/configloader.nim --replace "/usr/share/nimdow" "$out/share/nimdow" ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru.tests = { nimdow = nixosTests.nimdow; - version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "v${finalAttrs.version}"; - }; }; meta = with lib; diff --git a/pkgs/by-name/nu/numbat/package.nix b/pkgs/by-name/nu/numbat/package.nix index f9dcdb5031bdec6..e046b31310a8ec3 100644 --- a/pkgs/by-name/nu/numbat/package.nix +++ b/pkgs/by-name/nu/numbat/package.nix @@ -1,10 +1,9 @@ { lib , stdenv -, testers , fetchFromGitHub , rustPlatform , darwin -, numbat +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -31,9 +30,8 @@ rustPlatform.buildRustPackage rec { cp -r $src/${pname}/modules $out/share/${pname}/ ''; - passthru.tests.version = testers.testVersion { - package = numbat; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "High precision scientific calculator with full support for physical units"; diff --git a/pkgs/by-name/oc/ocsinventory-agent/package.nix b/pkgs/by-name/oc/ocsinventory-agent/package.nix index 7e5782cba0f1fd3..9e576f89f26753a 100644 --- a/pkgs/by-name/oc/ocsinventory-agent/package.nix +++ b/pkgs/by-name/oc/ocsinventory-agent/package.nix @@ -78,6 +78,7 @@ perlPackages.buildPerlPackage rec { passthru = { tests = { inherit (nixosTests) ocsinventory-agent; + # TODO: use `versionCheckHook` when the below is resolved version = testers.testVersion { package = ocsinventory-agent; command = "ocsinventory-agent --version"; diff --git a/pkgs/by-name/of/offpunk/package.nix b/pkgs/by-name/of/offpunk/package.nix index 5c107df67ebae40..df2015079dbc687 100644 --- a/pkgs/by-name/of/offpunk/package.nix +++ b/pkgs/by-name/of/offpunk/package.nix @@ -3,10 +3,9 @@ , installShellFiles , less , lib -, offpunk , python3Packages -, testers , timg +, versionCheckHook , xdg-utils , xsel }: @@ -51,7 +50,7 @@ python3Packages.buildPythonApplication rec { installManPage man/*.1 ''; - passthru.tests.version = testers.testVersion { package = offpunk; }; + nativeInstallCheckInputs = [ versionCheckHook ]; meta = { description = "Command-line and offline-first smolnet browser/feed reader"; diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index 31edc28dc8fa124..6a18d47aaf0b0b8 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -19,7 +19,7 @@ , autoAddDriverRunpath , nixosTests -, testers +, versionCheckHook , ollama , ollama-rocm , ollama-cuda @@ -205,13 +205,12 @@ goBuild ((lib.optionalAttrs enableRocm { "-X=github.com/ollama/ollama/server.mode=release" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru.tests = { inherit ollama; service = nixosTests.ollama; - version = testers.testVersion { - inherit version; - package = ollama; - }; } // lib.optionalAttrs stdenv.isLinux { inherit ollama-rocm ollama-cuda; }; diff --git a/pkgs/by-name/oo/oo7/package.nix b/pkgs/by-name/oo/oo7/package.nix index a126a27fd10790f..d47c49ea57108a5 100644 --- a/pkgs/by-name/oo/oo7/package.nix +++ b/pkgs/by-name/oo/oo7/package.nix @@ -3,10 +3,9 @@ rustPlatform, fetchFromGitHub, nix-update-script, - oo7, openssl, pkg-config, - testers, + versionCheckHook, }: rustPlatform.buildRustPackage rec { @@ -39,9 +38,12 @@ rustPlatform.buildRustPackage rec { --replace-fail "@bindir@" "$out/bin" ''; - passthru = { - tests.testVersion = testers.testVersion { package = oo7; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/oo7-cli"; + passthru = { # TODO: re-enable this when upstream adds a Cargo.lock # updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/op/openpgp-card-tools/package.nix b/pkgs/by-name/op/openpgp-card-tools/package.nix index 00a4be3e9ece3d6..2e8beeafab9b857 100644 --- a/pkgs/by-name/op/openpgp-card-tools/package.nix +++ b/pkgs/by-name/op/openpgp-card-tools/package.nix @@ -4,8 +4,7 @@ , fetchFromGitea , pkg-config , pcsclite -, testers -, openpgp-card-tools +, versionCheckHook , darwin }: @@ -30,11 +29,8 @@ rustPlatform.buildRustPackage rec { darwin.apple_sdk.frameworks.Security ]; - passthru = { - tests.version = testers.testVersion { - package = openpgp-card-tools; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Tool for inspecting and configuring OpenPGP cards"; diff --git a/pkgs/by-name/op/opensnitch/package.nix b/pkgs/by-name/op/opensnitch/package.nix index 41172f038cc85ac..705e0ee09483c8e 100644 --- a/pkgs/by-name/op/opensnitch/package.nix +++ b/pkgs/by-name/op/opensnitch/package.nix @@ -9,8 +9,7 @@ , iptables , makeWrapper , protoc-gen-go-grpc -, testers -, opensnitch +, versionCheckHook , nixosTests }: @@ -80,13 +79,11 @@ buildGoModule rec { --prefix PATH : ${lib.makeBinPath [ iptables ]} ''; - passthru.tests = { - inherit (nixosTests) opensnitch; - version = testers.testVersion { - package = opensnitch; - command = "opensnitchd -version"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/opensnitchd"; + versionCheckProgramArg = "-version"; meta = with lib; { description = "Application firewall"; diff --git a/pkgs/by-name/os/osm2pgsql/package.nix b/pkgs/by-name/os/osm2pgsql/package.nix index 0ddfb737fcee1a1..72888331a7c126d 100644 --- a/pkgs/by-name/os/osm2pgsql/package.nix +++ b/pkgs/by-name/os/osm2pgsql/package.nix @@ -18,7 +18,7 @@ , opencv , potrace , protozero -, testers +, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { @@ -57,6 +57,9 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + cmakeFlags = [ (lib.cmakeBool "EXTERNAL_LIBOSMIUM" true) (lib.cmakeBool "EXTERNAL_PROTOZERO" true) @@ -66,10 +69,6 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "install-gen" ]; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - meta = with lib; { description = "OpenStreetMap data to PostgreSQL converter"; homepage = "https://osm2pgsql.org"; diff --git a/pkgs/by-name/ot/otel-desktop-viewer/package.nix b/pkgs/by-name/ot/otel-desktop-viewer/package.nix index e8dc8f1844355fd..fe013f7a2c859e1 100644 --- a/pkgs/by-name/ot/otel-desktop-viewer/package.nix +++ b/pkgs/by-name/ot/otel-desktop-viewer/package.nix @@ -1,8 +1,7 @@ { lib , buildGoModule , fetchFromGitHub -, testers -, otel-desktop-viewer +, versionCheckHook }: buildGoModule rec { @@ -25,11 +24,8 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; - passthru.tests.version = testers.testVersion { - inherit version; - package = otel-desktop-viewer; - command = "otel-desktop-viewer --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { changelog = "https://github.com/CtrlSpice/otel-desktop-viewer/releases/tag/v${version}"; diff --git a/pkgs/by-name/pa/pack/package.nix b/pkgs/by-name/pa/pack/package.nix index 7f3b18ce43cdf36..fce037d7ff26773 100644 --- a/pkgs/by-name/pa/pack/package.nix +++ b/pkgs/by-name/pa/pack/package.nix @@ -3,8 +3,7 @@ buildGoModule, fetchFromGitHub, nix-update-script, - testers, - pack, + versionCheckHook, }: buildGoModule rec { @@ -28,9 +27,11 @@ buildGoModule rec { "-X github.com/buildpacks/pack.Version=${version}" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { package = pack; }; }; meta = { diff --git a/pkgs/by-name/pa/passt/package.nix b/pkgs/by-name/pa/passt/package.nix index 091c187d0481548..353b3bc5e1428ef 100644 --- a/pkgs/by-name/pa/passt/package.nix +++ b/pkgs/by-name/pa/passt/package.nix @@ -2,7 +2,7 @@ , stdenv , fetchurl , gitUpdater -, testers +, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { @@ -19,11 +19,10 @@ stdenv.mkDerivation (finalAttrs: { "VERSION=${finalAttrs.version}" ]; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = gitUpdater { url = "https://passt.top/passt"; }; diff --git a/pkgs/by-name/pa/patch2pr/package.nix b/pkgs/by-name/pa/patch2pr/package.nix index 0795adf94f5f868..ba568802cec02e9 100644 --- a/pkgs/by-name/pa/patch2pr/package.nix +++ b/pkgs/by-name/pa/patch2pr/package.nix @@ -1,8 +1,7 @@ { lib , buildGoModule , fetchFromGitHub -, testers -, patch2pr +, versionCheckHook }: buildGoModule rec { @@ -23,11 +22,8 @@ buildGoModule rec { "-X main.commit=${src.rev}" ]; - passthru.tests.patch2pr-version = testers.testVersion { - package = patch2pr; - command = "${patch2pr.meta.mainProgram} --version"; - version = version; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Create pull requests from patches without cloning the repository"; diff --git a/pkgs/by-name/pd/pdk/package.nix b/pkgs/by-name/pd/pdk/package.nix index 91bd27a53a442ac..5bfe5a67888ac85 100644 --- a/pkgs/by-name/pd/pdk/package.nix +++ b/pkgs/by-name/pd/pdk/package.nix @@ -20,6 +20,7 @@ bundlerApp { ''; passthru = { + # TODO: use `versionCheckHook` when possible tests.version = testers.testVersion { package = pdk; version = (import ./gemset.nix).pdk.version; diff --git a/pkgs/by-name/pg/pgcopydb/package.nix b/pkgs/by-name/pg/pgcopydb/package.nix index cc415c4d8a9d44e..5956f4d91bd3fde 100644 --- a/pkgs/by-name/pg/pgcopydb/package.nix +++ b/pkgs/by-name/pg/pgcopydb/package.nix @@ -8,7 +8,7 @@ , postgresql , readline , sqlite -, testers +, versionCheckHook , zlib }: @@ -48,11 +48,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Copy a Postgres database to a target Postgres server (pg_dump | pg_restore on steroids"; diff --git a/pkgs/by-name/pi/pinact/package.nix b/pkgs/by-name/pi/pinact/package.nix index 133688d22693701..cddf16635518bfe 100644 --- a/pkgs/by-name/pi/pinact/package.nix +++ b/pkgs/by-name/pi/pinact/package.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub , buildGoModule -, testers -, pinact +, versionCheckHook }: let @@ -22,11 +21,8 @@ buildGoModule { doCheck = true; - passthru.tests.version = testers.testVersion { - package = pinact; - command = "pinact --version"; - version = src.rev; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; ldflags = [ "-s" diff --git a/pkgs/by-name/pi/pixi/package.nix b/pkgs/by-name/pi/pixi/package.nix index 19206ad0146b1d2..872a8c1bd5f38d4 100644 --- a/pkgs/by-name/pi/pixi/package.nix +++ b/pkgs/by-name/pi/pixi/package.nix @@ -7,8 +7,7 @@ , openssl , installShellFiles , darwin -, testers -, pixi +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -87,9 +86,8 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/pixi completion --shell zsh) ''; - passthru.tests.version = testers.testVersion { - package = pixi; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Package management made easy"; diff --git a/pkgs/by-name/pl/platformsh/package.nix b/pkgs/by-name/pl/platformsh/package.nix index 23baedfebec289c..f9f3053e564d355 100644 --- a/pkgs/by-name/pl/platformsh/package.nix +++ b/pkgs/by-name/pl/platformsh/package.nix @@ -2,9 +2,8 @@ stdenvNoCC, lib, fetchurl, - testers, installShellFiles, - platformsh + versionCheckHook }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -50,12 +49,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - tests.version = testers.testVersion { - inherit (finalAttrs) version; - package = platformsh; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/platform"; meta = { description = "Unified tool for managing your Platform.sh services from the command line"; diff --git a/pkgs/by-name/pl/plow/package.nix b/pkgs/by-name/pl/plow/package.nix index 981787d16d94d0b..7443f0a0ae8e00e 100644 --- a/pkgs/by-name/pl/plow/package.nix +++ b/pkgs/by-name/pl/plow/package.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, testers, plow }: +{ lib, buildGoModule, fetchFromGitHub, versionCheckHook }: buildGoModule rec { pname = "plow"; @@ -15,9 +15,8 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; - passthru.tests.version = testers.testVersion { - package = plow; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "High-performance HTTP benchmarking tool that includes a real-time web UI and terminal display"; diff --git a/pkgs/by-name/po/powerpipe/package.nix b/pkgs/by-name/po/powerpipe/package.nix index 353d2a5ba493268..01c4a65b25a9504 100644 --- a/pkgs/by-name/po/powerpipe/package.nix +++ b/pkgs/by-name/po/powerpipe/package.nix @@ -5,8 +5,7 @@ lib, makeWrapper, nix-update-script, - powerpipe, - testers, + versionCheckHook, }: buildGoModule rec { @@ -51,12 +50,10 @@ buildGoModule rec { --set-default POWERPIPE_TELEMETRY none ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { - command = "${lib.getExe powerpipe} --version"; - package = powerpipe; - version = "v${version}"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/pr/presenterm/package.nix b/pkgs/by-name/pr/presenterm/package.nix index 5e7e767fef5957e..17119620cbac99f 100644 --- a/pkgs/by-name/pr/presenterm/package.nix +++ b/pkgs/by-name/pr/presenterm/package.nix @@ -2,9 +2,8 @@ , fetchFromGitHub , rustPlatform , libsixel -, testers -, presenterm , stdenv +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -31,10 +30,8 @@ rustPlatform.buildRustPackage rec { # Skip test that currently doesn't work checkFlags = [ "--skip=execute::test::shell_code_execution" ]; - passthru.tests.version = testers.testVersion { - package = presenterm; - command = "presenterm --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Terminal based slideshow tool"; diff --git a/pkgs/by-name/pu/puppet-bolt/package.nix b/pkgs/by-name/pu/puppet-bolt/package.nix index a93775269855991..b8ebdac95e31718 100644 --- a/pkgs/by-name/pu/puppet-bolt/package.nix +++ b/pkgs/by-name/pu/puppet-bolt/package.nix @@ -29,6 +29,7 @@ ''; passthru = { + # TODO: use `versionCheckHook` when possible tests.version = testers.testVersion { package = puppet-bolt; version = (import ./gemset.nix).bolt.version; diff --git a/pkgs/by-name/pu/puppet-lint/package.nix b/pkgs/by-name/pu/puppet-lint/package.nix index 588d9f0c86fad69..2d21cb4a6c61fdd 100644 --- a/pkgs/by-name/pu/puppet-lint/package.nix +++ b/pkgs/by-name/pu/puppet-lint/package.nix @@ -12,6 +12,7 @@ bundlerApp { exes = [ "puppet-lint" ]; passthru = { + # TODO: use `versionCheckHook` when possible tests.version = testers.testVersion { package = puppet-lint; version = (import ./gemset.nix).puppet-lint.version; diff --git a/pkgs/by-name/pu/puppet/package.nix b/pkgs/by-name/pu/puppet/package.nix index 9d5f738cad7e481..a8069dcb010a5e5 100644 --- a/pkgs/by-name/pu/puppet/package.nix +++ b/pkgs/by-name/pu/puppet/package.nix @@ -12,6 +12,7 @@ bundlerApp { exes = [ "puppet" ]; passthru = { + # TODO: use `versionCheckHook` when possible tests.version = testers.testVersion { package = puppet; command = "HOME=$(mktemp -d) puppet --version"; diff --git a/pkgs/by-name/pu/purescm/package.nix b/pkgs/by-name/pu/purescm/package.nix index 0eebd7f23e179dd..8b56a66890e4bc4 100644 --- a/pkgs/by-name/pu/purescm/package.nix +++ b/pkgs/by-name/pu/purescm/package.nix @@ -1,7 +1,7 @@ { lib , buildNpmPackage , fetchNpmDeps -, testers +, versionCheckHook }: let @@ -42,9 +42,8 @@ let ln -s $out/share/${pname}/node_modules/.bin $out/bin ''; - passthru.tests = { - version = testers.testVersion { inherit package; }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Chez Scheme back-end for PureScript"; diff --git a/pkgs/by-name/qu/quickemu/package.nix b/pkgs/by-name/qu/quickemu/package.nix index 1f8e0cf07118c19..9f63910f25f1335 100644 --- a/pkgs/by-name/qu/quickemu/package.nix +++ b/pkgs/by-name/qu/quickemu/package.nix @@ -26,8 +26,7 @@ zsync, OVMF, OVMFFull, - quickemu, - testers, + versionCheckHook, installShellFiles, }: let @@ -99,9 +98,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.tests = testers.testVersion { - package = quickemu; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Quickly create and run optimised Windows, macOS and Linux virtual machines"; diff --git a/pkgs/by-name/qu/quickjs-ng/package.nix b/pkgs/by-name/qu/quickjs-ng/package.nix index 887c482e6c86f8e..eb7ec64b37665ed 100644 --- a/pkgs/by-name/qu/quickjs-ng/package.nix +++ b/pkgs/by-name/qu/quickjs-ng/package.nix @@ -2,8 +2,8 @@ , stdenv , cmake , fetchFromGitHub -, testers , texinfo +, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { @@ -39,12 +39,10 @@ stdenv.mkDerivation (finalAttrs: { install -Dt $info/share/info/ quickjs.info) ''; - passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "qjs --help || true"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "qjs"; meta = with lib; { description = "Mighty JavaScript engine"; diff --git a/pkgs/by-name/qu/quicktype/package.nix b/pkgs/by-name/qu/quicktype/package.nix index ecf33e6e92a57b3..6c364c6c99ff181 100644 --- a/pkgs/by-name/qu/quicktype/package.nix +++ b/pkgs/by-name/qu/quicktype/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNpmPackage, fetchFromGitHub, jq, quicktype, testers }: +{ lib, buildNpmPackage, fetchFromGitHub, jq, versionCheckHook }: buildNpmPackage rec { pname = "quicktype"; @@ -21,9 +21,8 @@ buildNpmPackage rec { mv packages/ $out/lib/node_modules/quicktype/ ''; - passthru.tests = { - version = testers.testVersion { package = quicktype; }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Generate types and converters from JSON, Schema, and GraphQL"; diff --git a/pkgs/by-name/r1/r10k/package.nix b/pkgs/by-name/r1/r10k/package.nix index ab38363ab596629..a1d10112309dfa1 100644 --- a/pkgs/by-name/r1/r10k/package.nix +++ b/pkgs/by-name/r1/r10k/package.nix @@ -28,6 +28,7 @@ bundlerApp { ''; passthru = { + # TODO: use `versionCheckHook` if possible tests.version = testers.testVersion { command = "${lib.getExe r10k} version"; package = r10k; diff --git a/pkgs/by-name/ra/radicle-node/package.nix b/pkgs/by-name/ra/radicle-node/package.nix index 7453899f8b06c85..9e4aa58a107cb47 100644 --- a/pkgs/by-name/ra/radicle-node/package.nix +++ b/pkgs/by-name/ra/radicle-node/package.nix @@ -12,7 +12,7 @@ , runCommand , rustPlatform , stdenv -, testers +, versionCheckHook , xdg-utils }: rustPlatform.buildRustPackage rec { pname = "radicle-node"; @@ -64,12 +64,16 @@ done ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/rad"; + passthru.tests = let package = radicle-node; in { - version = testers.testVersion { inherit package; }; basic = runCommand "${package.name}-basic-test" { nativeBuildInputs = [ jq openssh radicle-node ]; diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix index b90dd2d56a6172a..45537214cede029 100644 --- a/pkgs/by-name/ra/rav1e/package.nix +++ b/pkgs/by-name/ra/rav1e/package.nix @@ -10,9 +10,8 @@ libgit2, libiconv, nasm, - testers, + versionCheckHook, zlib, - rav1e, }: rustPlatform.buildRustPackage rec { @@ -41,6 +40,9 @@ rustPlatform.buildRustPackage rec { darwin.apple_sdk.frameworks.Security ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + # Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library # and linking it with cctools ld64. postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' @@ -57,10 +59,6 @@ rustPlatform.buildRustPackage rec { ${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget} ''; - passthru = { - tests.version = testers.testVersion { package = rav1e; }; - }; - meta = { description = "Fastest and safest AV1 encoder"; longDescription = '' diff --git a/pkgs/by-name/rc/rcu/package.nix b/pkgs/by-name/rc/rcu/package.nix index ea319d0d8b19353..37dc79cc61c2813 100644 --- a/pkgs/by-name/rc/rcu/package.nix +++ b/pkgs/by-name/rc/rcu/package.nix @@ -2,14 +2,13 @@ , lib , requireFile , runCommand -, rcu -, testers , copyDesktopItems , desktopToDarwinBundle , libsForQt5 , makeDesktopItem , python3Packages , system-config-printer +, versionCheckHook }: python3Packages.buildPythonApplication rec { @@ -131,15 +130,8 @@ python3Packages.buildPythonApplication rec { --add-flags $out/share/rcu/main.py ''; - passthru = { - tests.version = testers.testVersion { - package = rcu; - version = let - versionSuffixPos = (lib.strings.stringLength rcu.version) - 1; - in - "d${lib.strings.substring 0 versionSuffixPos rcu.version}(${lib.strings.substring versionSuffixPos 1 rcu.version})"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { mainProgram = "rcu"; diff --git a/pkgs/by-name/re/redocly/package.nix b/pkgs/by-name/re/redocly/package.nix index 71df968a3d79624..d3a75c6e54345aa 100644 --- a/pkgs/by-name/re/redocly/package.nix +++ b/pkgs/by-name/re/redocly/package.nix @@ -2,8 +2,7 @@ , buildNpmPackage , fetchFromGitHub , makeWrapper -, redocly -, testers +, versionCheckHook }: buildNpmPackage rec { @@ -42,11 +41,8 @@ buildNpmPackage rec { ln -s $out/bin/redocly $out/bin/redocly-cli ''; - passthru = { - tests.version = testers.testVersion { - package = redocly; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { changelog = "https://redocly.com/docs/cli/changelog/"; diff --git a/pkgs/by-name/re/renovate/package.nix b/pkgs/by-name/re/renovate/package.nix index e15fff10eab72b7..64f7922946f72f4 100644 --- a/pkgs/by-name/re/renovate/package.nix +++ b/pkgs/by-name/re/renovate/package.nix @@ -7,11 +7,10 @@ overrideSDK, pnpm_9, python3, - renovate, - testers, xcbuild, nixosTests, nix-update-script, + versionCheckHook }: let @@ -89,9 +88,11 @@ stdenv'.mkDerivation (finalAttrs: { runHook postInstall ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { tests = { - version = testers.testVersion { package = renovate; }; vm-test = nixosTests.renovate; }; updateScript = nix-update-script { }; diff --git a/pkgs/by-name/re/revup/package.nix b/pkgs/by-name/re/revup/package.nix index 4fb1e309b20153b..900b920ca768be1 100644 --- a/pkgs/by-name/re/revup/package.nix +++ b/pkgs/by-name/re/revup/package.nix @@ -3,7 +3,7 @@ fetchPypi, gitUpdater, python3Packages, - testers, + versionCheckHook }: let @@ -39,11 +39,11 @@ let pytest ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = gitUpdater { }; - tests.version = testers.testVersion { - package = self; - }; }; meta = { diff --git a/pkgs/by-name/ri/ripunzip/package.nix b/pkgs/by-name/ri/ripunzip/package.nix index 43ec13dcda17320..1f333561f40a6b9 100644 --- a/pkgs/by-name/ri/ripunzip/package.nix +++ b/pkgs/by-name/ri/ripunzip/package.nix @@ -8,6 +8,7 @@ , testers , fetchzip , ripunzip +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -29,14 +30,14 @@ rustPlatform.buildRustPackage rec { setupHook = ./setup-hook.sh; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru.tests = { fetchzipWithRipunzip = testers.invalidateFetcherByDrvHash (fetchzip.override { unzip = ripunzip; }) { url = "https://github.com/google/ripunzip/archive/cb9caa3ba4b0e27a85e165be64c40f1f6dfcc085.zip"; hash = "sha256-BoErC5VL3Vpvkx6xJq6J+eUJrBnjVEdTuSo7zh98Jy4="; }; - version = testers.testVersion { - package = ripunzip; - }; }; meta = with lib; { diff --git a/pkgs/by-name/ro/roave-backward-compatibility-check/package.nix b/pkgs/by-name/ro/roave-backward-compatibility-check/package.nix index a9b5bedbca0c879..d3a0b068e2977f5 100644 --- a/pkgs/by-name/ro/roave-backward-compatibility-check/package.nix +++ b/pkgs/by-name/ro/roave-backward-compatibility-check/package.nix @@ -2,8 +2,7 @@ lib, fetchFromGitHub, php, - testers, - roave-backward-compatibility-check, + versionCheckHook, }: php.buildComposerProject (finalAttrs: { @@ -19,12 +18,8 @@ php.buildComposerProject (finalAttrs: { vendorHash = "sha256-I8JZ4CBrrQmZ38QF9SPZtkPirCAxqSCeTUpMg59Mz7U="; - passthru = { - tests.version = testers.testVersion { - package = roave-backward-compatibility-check; - version = finalAttrs.version; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { changelog = "https://github.com/Roave/BackwardCompatibilityCheck/releases/tag/${finalAttrs.version}"; diff --git a/pkgs/by-name/ro/rosa/package.nix b/pkgs/by-name/ro/rosa/package.nix index 25ac1e682584eac..204867f1220009b 100644 --- a/pkgs/by-name/ro/rosa/package.nix +++ b/pkgs/by-name/ro/rosa/package.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, rosa, nix-update-script }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, nix-update-script, versionCheckHook }: buildGoModule rec { pname = "rosa"; @@ -36,11 +36,12 @@ buildGoModule rec { --zsh <($out/bin/rosa completion zsh) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version --client"; + passthru = { - tests.version = testers.testVersion { - package = rosa; - command = "rosa version --client"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ro/roslyn-ls/package.nix b/pkgs/by-name/ro/roslyn-ls/package.nix index bc50c7f10cda919..c923512785acdf3 100644 --- a/pkgs/by-name/ro/roslyn-ls/package.nix +++ b/pkgs/by-name/ro/roslyn-ls/package.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, stdenvNoCC, testers, roslyn-ls, jq }: +{ lib, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, stdenvNoCC, versionCheckHook, jq }: let pname = "roslyn-ls"; # see https://github.com/dotnet/roslyn/blob/main/eng/targets/TargetFrameworks.props @@ -73,8 +73,12 @@ buildDotnetModule rec { runHook postInstall ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "Microsoft.CodeAnalysis.LanguageServer"; + passthru = { - tests.version = testers.testVersion { package = roslyn-ls; }; updateScript = ./update.sh; }; diff --git a/pkgs/by-name/rs/rsmangler/package.nix b/pkgs/by-name/rs/rsmangler/package.nix index 7621eb14a752a06..e5204292f51e9af 100644 --- a/pkgs/by-name/rs/rsmangler/package.nix +++ b/pkgs/by-name/rs/rsmangler/package.nix @@ -1,8 +1,8 @@ { lib , stdenvNoCC , fetchFromGitHub -, testers , ruby +, versionCheckHook }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -28,11 +28,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { install -Dm555 rsmangler.rb $out/bin/rsmangler ''; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "rsmangler --help"; - version = "rsmangler v ${lib.versions.majorMinor finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Perform various manipulations on the wordlists"; diff --git a/pkgs/by-name/sh/shopify-cli/package.nix b/pkgs/by-name/sh/shopify-cli/package.nix index c850d4740b80af2..754617dfee04a5e 100644 --- a/pkgs/by-name/sh/shopify-cli/package.nix +++ b/pkgs/by-name/sh/shopify-cli/package.nix @@ -1,4 +1,4 @@ -{ buildNpmPackage, lib, makeWrapper, bundlerEnv, testers, shopify-cli }: +{ buildNpmPackage, lib, makeWrapper, bundlerEnv, versionCheckHook }: let version = "3.63.2"; @@ -27,10 +27,6 @@ buildNpmPackage { passthru = { updateScript = ./update.sh; - tests.version = testers.testVersion { - package = shopify-cli; - command = "shopify version"; - }; }; postInstall = '' @@ -45,6 +41,11 @@ buildNpmPackage { --set SHOPIFY_CLI_BUNDLED_THEME_CLI 0 ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + meta = { platforms = lib.platforms.all; mainProgram = "shopify"; diff --git a/pkgs/by-name/sh/shpool/package.nix b/pkgs/by-name/sh/shpool/package.nix index 34c59c05c563ae3..045d5b0a6ce1288 100644 --- a/pkgs/by-name/sh/shpool/package.nix +++ b/pkgs/by-name/sh/shpool/package.nix @@ -3,8 +3,7 @@ rustPlatform, fetchFromGitHub, linux-pam, - testers, - shpool, + versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -41,10 +40,10 @@ rustPlatform.buildRustPackage rec { install -Dm444 systemd/shpool.socket -t $out/lib/systemd/user ''; - passthru.tests.version = testers.testVersion { - command = "shpool version"; - package = shpool; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; meta = { description = "Persistent session management like tmux, but more lightweight"; diff --git a/pkgs/by-name/si/sigi/package.nix b/pkgs/by-name/si/sigi/package.nix index 9bab8e985375bce..a7cb122272b2e84 100644 --- a/pkgs/by-name/si/sigi/package.nix +++ b/pkgs/by-name/si/sigi/package.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchCrate, installShellFiles, testers, sigi }: +{ lib, rustPlatform, fetchCrate, installShellFiles, versionCheckHook }: rustPlatform.buildRustPackage rec { pname = "sigi"; @@ -19,7 +19,8 @@ rustPlatform.buildRustPackage rec { installManPage sigi.1 ''; - passthru.tests.version = testers.testVersion { package = sigi; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Organizing CLI for people who don't love organizing"; diff --git a/pkgs/by-name/sk/sketchybar/package.nix b/pkgs/by-name/sk/sketchybar/package.nix index 0b1b4e21acd1659..c0cae217a59bb3f 100644 --- a/pkgs/by-name/sk/sketchybar/package.nix +++ b/pkgs/by-name/sk/sketchybar/package.nix @@ -4,8 +4,8 @@ stdenv, darwin, fetchFromGitHub, - testers, nix-update-script, + versionCheckHook, }: let @@ -65,12 +65,10 @@ stdenv'.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "sketchybar-v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/sk/skhd/package.nix b/pkgs/by-name/sk/skhd/package.nix index d3b3b9adb96a988..2b49e044035268c 100644 --- a/pkgs/by-name/sk/skhd/package.nix +++ b/pkgs/by-name/sk/skhd/package.nix @@ -4,8 +4,8 @@ stdenv, darwin, fetchFromGitHub, - testers, nix-update-script, + versionCheckHook, }: let inherit (darwin.apple_sdk_11_0.frameworks) Carbon Cocoa; @@ -38,12 +38,10 @@ stdenv'.mkDerivation (finalAttrs: { substituteInPlace $out/Library/LaunchDaemons/org.nixos.skhd.plist --subst-var out ''; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "skhd-v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/sm/smassh/package.nix b/pkgs/by-name/sm/smassh/package.nix index d723be41d2b9b09..108fd30cdc0f311 100644 --- a/pkgs/by-name/sm/smassh/package.nix +++ b/pkgs/by-name/sm/smassh/package.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub -, smassh , python3 -, testers +, versionCheckHook }: python3.pkgs.buildPythonApplication rec { @@ -32,13 +31,14 @@ python3.pkgs.buildPythonApplication rec { requests ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + # No tests available doCheck = false; - passthru.tests.version = testers.testVersion { - package = smassh; - command = "HOME=$(mktemp -d) smassh --version"; - }; + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; meta = with lib; { description = "TUI based typing test application inspired by MonkeyType"; diff --git a/pkgs/by-name/so/soupault/package.nix b/pkgs/by-name/so/soupault/package.nix index c38e58d181d9744..162f836f7ce068c 100644 --- a/pkgs/by-name/so/soupault/package.nix +++ b/pkgs/by-name/so/soupault/package.nix @@ -2,9 +2,8 @@ , darwin , fetchzip , ocamlPackages -, soupault , stdenv -, testers +, versionCheckHook }: ocamlPackages.buildDunePackage rec { @@ -45,10 +44,10 @@ ocamlPackages.buildDunePackage rec { yaml ]; - passthru.tests.version = testers.testVersion { - package = soupault; - command = "soupault --version-number"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "--version-number"; meta = { description = "Tool that helps you create and manage static websites"; diff --git a/pkgs/by-name/sp/spicetify-cli/package.nix b/pkgs/by-name/sp/spicetify-cli/package.nix index a2578f6687a0bfa..745e20650ff7173 100644 --- a/pkgs/by-name/sp/spicetify-cli/package.nix +++ b/pkgs/by-name/sp/spicetify-cli/package.nix @@ -2,8 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - testers, - spicetify-cli, + versionCheckHook }: buildGoModule rec { @@ -34,12 +33,10 @@ buildGoModule rec { cp -r ${src}/Themes $out/bin/Themes ''; + nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; - installCheckPhase = '' - $out/bin/spicetify --help > /dev/null - ''; - passthru.tests.version = testers.testVersion { package = spicetify-cli; }; + versionCheckProgram = "${placeholder "out"}/bin/spicetify"; meta = with lib; { description = "Command-line tool to customize Spotify client"; diff --git a/pkgs/by-name/st/stackit-cli/package.nix b/pkgs/by-name/st/stackit-cli/package.nix index 790978872c9e133..6cf0edb4fb897a0 100644 --- a/pkgs/by-name/st/stackit-cli/package.nix +++ b/pkgs/by-name/st/stackit-cli/package.nix @@ -5,9 +5,7 @@ , makeWrapper , less , xdg-utils -, testers -, runCommand -, stackit-cli +, versionCheckHook }: buildGoModule rec { @@ -53,12 +51,10 @@ buildGoModule rec { nativeCheckInputs = [ less ]; - passthru.tests = { - version = testers.testVersion { - package = stackit-cli; - command = "stackit --version"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "stackit"; meta = with lib; { description = "CLI to manage STACKIT cloud services"; diff --git a/pkgs/by-name/st/stackql/package.nix b/pkgs/by-name/st/stackql/package.nix index d1d749d971faefa..ea06f19ddcd90e7 100644 --- a/pkgs/by-name/st/stackql/package.nix +++ b/pkgs/by-name/st/stackql/package.nix @@ -2,8 +2,7 @@ lib, fetchFromGitHub, buildGoModule, - testers, - stackql, + versionCheckHook }: buildGoModule rec { @@ -33,10 +32,8 @@ buildGoModule rec { checkFlags = [ "--tags json1,sqleanal" ]; - passthru.tests.version = testers.testVersion { - package = stackql; - version = "v${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { homepage = "https://github.com/stackql/stackql"; diff --git a/pkgs/by-name/st/static-server/package.nix b/pkgs/by-name/st/static-server/package.nix index 4ec8b8c20852ad8..43e57ba5af7064b 100644 --- a/pkgs/by-name/st/static-server/package.nix +++ b/pkgs/by-name/st/static-server/package.nix @@ -3,9 +3,8 @@ , fetchFromGitHub , curl , stdenv -, testers -, static-server , substituteAll +, versionCheckHook }: buildGoModule rec { @@ -38,11 +37,8 @@ buildGoModule rec { # tests sometimes fail with SIGQUIT on darwin doCheck = !stdenv.isDarwin; - passthru.tests = { - version = testers.testVersion { - package = static-server; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/st/steampipe/package.nix b/pkgs/by-name/st/steampipe/package.nix index e52182508c06492..929839280c03068 100644 --- a/pkgs/by-name/st/steampipe/package.nix +++ b/pkgs/by-name/st/steampipe/package.nix @@ -5,8 +5,7 @@ lib, makeWrapper, nix-update-script, - steampipe, - testers, + versionCheckHook }: buildGoModule rec { @@ -65,12 +64,10 @@ buildGoModule rec { --zsh <($out/bin/steampipe --install-dir $INSTALL_DIR completion zsh) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { - command = "${lib.getExe steampipe} --version"; - package = steampipe; - version = "v${version}"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/st/storcli/package.nix b/pkgs/by-name/st/storcli/package.nix index bb1e92247663cac..6a6ba8bd9fb3959 100644 --- a/pkgs/by-name/st/storcli/package.nix +++ b/pkgs/by-name/st/storcli/package.nix @@ -2,7 +2,7 @@ , stdenvNoCC , fetchzip , rpmextract -, testers +, versionCheckHook }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -40,11 +40,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { # Not needed because the binary is statically linked dontFixup = true; - passthru.tests = testers.testVersion { - package = finalAttrs.finalPackage; - command = "${finalAttrs.meta.mainProgram} -v"; - version = "00${finalAttrs.version}00.0000"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { # Unfortunately there is no better page for this. diff --git a/pkgs/by-name/st/stu/package.nix b/pkgs/by-name/st/stu/package.nix index c1e2454a73f8b84..c6cc803e1ccb301 100644 --- a/pkgs/by-name/st/stu/package.nix +++ b/pkgs/by-name/st/stu/package.nix @@ -4,8 +4,7 @@ rustPlatform, stdenv, darwin, - stu, - testers, + versionCheckHook, }: let version = "0.5.0"; @@ -28,7 +27,8 @@ rustPlatform.buildRustPackage { darwin.apple_sdk.frameworks.CoreGraphics ]; - passthru.tests.version = testers.testVersion { package = stu; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Terminal file explorer for S3 buckets"; diff --git a/pkgs/by-name/su/surrealdb/package.nix b/pkgs/by-name/su/surrealdb/package.nix index 4e69f2d1e87f543..6e7ca362e906b35 100644 --- a/pkgs/by-name/su/surrealdb/package.nix +++ b/pkgs/by-name/su/surrealdb/package.nix @@ -5,10 +5,9 @@ , pkg-config , openssl , rocksdb_8_3 -, testers -, surrealdb , darwin , protobuf +, versionCheckHook }: let @@ -59,10 +58,11 @@ rustPlatform.buildRustPackage rec { __darwinAllowLocalNetworking = true; - passthru.tests.version = testers.testVersion { - package = surrealdb; - command = "surreal version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "surreal"; + versionCheckProgramArg = "version"; meta = with lib; { description = "Scalable, distributed, collaborative, document-graph database, for the realtime web"; diff --git a/pkgs/by-name/sw/swayfx-unwrapped/package.nix b/pkgs/by-name/sw/swayfx-unwrapped/package.nix index b90220a7c1ff401..e22352c604b49c4 100644 --- a/pkgs/by-name/sw/swayfx-unwrapped/package.nix +++ b/pkgs/by-name/sw/swayfx-unwrapped/package.nix @@ -23,10 +23,10 @@ libevdev, scdoc, scenefx, + versionCheckHook, wayland-scanner, xcbutilwm, wlroots, - testers, nixosTests, # Used by the NixOS module: isNixOS ? false, @@ -120,14 +120,12 @@ stdenv.mkDerivation (finalAttrs: { (mesonEnable "tray" finalAttrs.trayEnabled) ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { tests = { basic = nixosTests.swayfx; - version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "sway --version"; - version = "swayfx version ${finalAttrs.version}"; - }; }; }; diff --git a/pkgs/by-name/sw/swayimg/package.nix b/pkgs/by-name/sw/swayimg/package.nix index a6e1a4a8d48d981..c14b1a84e856b62 100644 --- a/pkgs/by-name/sw/swayimg/package.nix +++ b/pkgs/by-name/sw/swayimg/package.nix @@ -22,7 +22,7 @@ , libavif , openexr_3 , bash-completion -, testers +, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { pname = "swayimg"; @@ -67,9 +67,8 @@ stdenv.mkDerivation (finalAttrs: { openexr_3 ]; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { homepage = "https://github.com/artemsen/swayimg"; diff --git a/pkgs/by-name/sy/symfony-cli/package.nix b/pkgs/by-name/sy/symfony-cli/package.nix index 2d9a28bf141000b..481cea9168f4112 100644 --- a/pkgs/by-name/sy/symfony-cli/package.nix +++ b/pkgs/by-name/sy/symfony-cli/package.nix @@ -2,10 +2,9 @@ , fetchFromGitHub , lib , nix-update-script -, testers -, symfony-cli , nssTools , makeBinaryWrapper +, versionCheckHook }: buildGoModule rec { @@ -49,13 +48,14 @@ buildGoModule rec { # Tests requires network access doCheck = false; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/symfony"; + versionCheckProgramArg = "version --no-ansi"; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - inherit version; - package = symfony-cli; - command = "symfony version --no-ansi"; - }; }; meta = { diff --git a/pkgs/by-name/te/tenv/package.nix b/pkgs/by-name/te/tenv/package.nix index f1af42f8c888af1..5b2f6e99e3e5638 100644 --- a/pkgs/by-name/te/tenv/package.nix +++ b/pkgs/by-name/te/tenv/package.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, installShellFiles, lib, tenv, testers }: +{ buildGoModule, fetchFromGitHub, installShellFiles, lib, versionCheckHook }: buildGoModule rec { pname = "tenv"; @@ -30,11 +30,12 @@ buildGoModule rec { --fish <($out/bin/tenv completion fish) ''; - passthru.tests.version = testers.testVersion { - command = "HOME=$TMPDIR tenv --version"; - package = tenv; - version = "v${version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; meta = { changelog = "https://github.com/tofuutils/tenv/releases/tag/v${version}"; diff --git a/pkgs/by-name/te/terraform-plugin-docs/package.nix b/pkgs/by-name/te/terraform-plugin-docs/package.nix index 01e53dd08f2b1f6..ad5bfc1701fabf2 100644 --- a/pkgs/by-name/te/terraform-plugin-docs/package.nix +++ b/pkgs/by-name/te/terraform-plugin-docs/package.nix @@ -3,8 +3,7 @@ , fetchFromGitHub , makeWrapper , go -, testers -, terraform-plugin-docs +, versionCheckHook , nix-update-script }: @@ -42,11 +41,12 @@ buildGoModule rec { wrapProgram $out/bin/tfplugindocs --prefix PATH : ${lib.makeBinPath [ go ]} ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "tfplugindocs"; + passthru = { - tests.version = testers.testVersion { - command = "tfplugindocs --version"; - package = terraform-plugin-docs; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ti/tigerbeetle/package.nix b/pkgs/by-name/ti/tigerbeetle/package.nix index 0d5bfea5f77bb97..cd16afb41d5a283 100644 --- a/pkgs/by-name/ti/tigerbeetle/package.nix +++ b/pkgs/by-name/ti/tigerbeetle/package.nix @@ -2,9 +2,8 @@ , stdenv , fetchFromGitHub , zig_0_11 -, testers -, tigerbeetle , nix-update-script +, versionCheckHook }: let # Read [these comments](pkgs/development/compilers/zig/hook.nix#L12-L30) on the default Zig flags, and the associated links. tigerbeetle stopped exposing the `-Doptimize` build flag, so we can't use the default Nixpkgs zig hook as-is. tigerbeetle only exposes a boolean `-Drelease` flag which we'll add in the tigerbeetle derivation in this file. @@ -32,11 +31,10 @@ stdenv.mkDerivation (finalAttrs: { "-Dgit-commit=0000000000000000000000000000000000000000" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { - package = tigerbeetle; - command = "tigerbeetle version"; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ti/tilemaker/package.nix b/pkgs/by-name/ti/tilemaker/package.nix index 7e7714635c891d8..553b006024e8392 100644 --- a/pkgs/by-name/ti/tilemaker/package.nix +++ b/pkgs/by-name/ti/tilemaker/package.nix @@ -10,8 +10,8 @@ , rapidjson , shapelib , sqlite +, versionCheckHook , zlib -, testers }: stdenv.mkDerivation (finalAttrs: { @@ -48,10 +48,8 @@ stdenv.mkDerivation (finalAttrs: { cp -r ../server/static $out/share/tilemaker ''; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "tilemaker --help"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Make OpenStreetMap vector tiles without the stack"; diff --git a/pkgs/by-name/ti/tinymist/package.nix b/pkgs/by-name/ti/tinymist/package.nix index 083ec3f60745eae..72cecfb73e687f2 100644 --- a/pkgs/by-name/ti/tinymist/package.nix +++ b/pkgs/by-name/ti/tinymist/package.nix @@ -8,8 +8,7 @@ , stdenv , darwin , nix-update-script -, testers -, tinymist +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -53,12 +52,13 @@ rustPlatform.buildRustPackage rec { "--skip=e2e" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "-V"; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - command = "${meta.mainProgram} -V"; - package = tinymist; - }; }; meta = { diff --git a/pkgs/by-name/ti/tippecanoe/package.nix b/pkgs/by-name/ti/tippecanoe/package.nix index 05d19692f375cab..afa3a70cd0aadc7 100644 --- a/pkgs/by-name/ti/tippecanoe/package.nix +++ b/pkgs/by-name/ti/tippecanoe/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, sqlite, zlib, perl, testers }: +{ lib, stdenv, fetchFromGitHub, sqlite, zlib, perl, versionCheckHook }: stdenv.mkDerivation (finalAttrs: { pname = "tippecanoe"; @@ -21,10 +21,8 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/felt/tippecanoe/issues/148 doCheck = false; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Build vector tilesets from large collections of GeoJSON features"; diff --git a/pkgs/by-name/to/toml-cli/package.nix b/pkgs/by-name/to/toml-cli/package.nix index 738e6deba141248..f31ac4bdd53d1af 100644 --- a/pkgs/by-name/to/toml-cli/package.nix +++ b/pkgs/by-name/to/toml-cli/package.nix @@ -1,4 +1,4 @@ -{ lib, fetchCrate, rustPlatform, testers, toml-cli }: +{ lib, fetchCrate, rustPlatform, versionCheckHook }: rustPlatform.buildRustPackage rec { pname = "toml-cli"; @@ -19,9 +19,8 @@ rustPlatform.buildRustPackage rec { # "--test=integration" ]; - passthru.tests = { - version = testers.testVersion { package = toml-cli; }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Simple CLI for editing and querying TOML files"; diff --git a/pkgs/by-name/tp/tpnote/package.nix b/pkgs/by-name/tp/tpnote/package.nix index 76ace9184996b20..37dd18f517f634e 100644 --- a/pkgs/by-name/tp/tpnote/package.nix +++ b/pkgs/by-name/tp/tpnote/package.nix @@ -7,8 +7,7 @@ , oniguruma , darwin , installShellFiles -, tpnote -, testers +, versionCheckHook }: @@ -45,7 +44,8 @@ rustPlatform.buildRustPackage rec { RUSTONIG_SYSTEM_LIBONIG = true; - passthru.tests.version = testers.testVersion { package = tpnote; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; # The `tpnote` crate has no unit tests. All tests are in `tpnote-lib`. checkType = "debug"; diff --git a/pkgs/by-name/tr/trealla/package.nix b/pkgs/by-name/tr/trealla/package.nix index b52d24a34178649..f61e9fec74dd332 100644 --- a/pkgs/by-name/tr/trealla/package.nix +++ b/pkgs/by-name/tr/trealla/package.nix @@ -5,8 +5,8 @@ openssl, readline, stdenv, - testers, valgrind, + versionCheckHook, xxd, # Boolean flags checkLeaks ? false, @@ -69,14 +69,10 @@ stdenv.mkDerivation (finalAttrs: { checkFlags = [ "test" ] ++ lib.optionals checkLeaks [ "leaks" ]; - passthru = { - tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "v${finalAttrs.version}"; - }; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/tpl"; meta = { homepage = "https://trealla-prolog.github.io/trealla/"; diff --git a/pkgs/by-name/tt/ttop/package.nix b/pkgs/by-name/tt/ttop/package.nix index 013bac08fea2466..5bc3f9dc3786730 100644 --- a/pkgs/by-name/tt/ttop/package.nix +++ b/pkgs/by-name/tt/ttop/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNimPackage, fetchFromGitHub, testers }: +{ lib, buildNimPackage, fetchFromGitHub, versionCheckHook }: buildNimPackage (finalAttrs: { pname = "ttop"; @@ -17,11 +17,8 @@ buildNimPackage (finalAttrs: { "-d:NimblePkgVersion=${finalAttrs.version}" ]; - passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Top-like system monitoring tool"; diff --git a/pkgs/by-name/ty/typescript-language-server/package.nix b/pkgs/by-name/ty/typescript-language-server/package.nix index 053f665ce7eb242..c2c6b3085bad06d 100644 --- a/pkgs/by-name/ty/typescript-language-server/package.nix +++ b/pkgs/by-name/ty/typescript-language-server/package.nix @@ -6,8 +6,8 @@ , makeWrapper , nodejs , prefetch-yarn-deps +, versionCheckHook , yarn -, testers }: stdenv.mkDerivation (finalAttrs: { @@ -68,11 +68,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { changelog = "https://github.com/typescript-language-server/typescript-language-server/releases/tag/v${finalAttrs.version}"; diff --git a/pkgs/by-name/ty/typstyle/package.nix b/pkgs/by-name/ty/typstyle/package.nix index 4db419b7439505d..540ffca60f06470 100644 --- a/pkgs/by-name/ty/typstyle/package.nix +++ b/pkgs/by-name/ty/typstyle/package.nix @@ -7,8 +7,7 @@ , stdenv , darwin , nix-update-script -, testers -, typstyle +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -43,9 +42,11 @@ rustPlatform.buildRustPackage rec { "--skip=e2e" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { package = typstyle; }; }; meta = { diff --git a/pkgs/by-name/ug/uglify-js/package.nix b/pkgs/by-name/ug/uglify-js/package.nix index 4056c78af31f083..97c1b57c1632506 100644 --- a/pkgs/by-name/ug/uglify-js/package.nix +++ b/pkgs/by-name/ug/uglify-js/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, testers, runCommand, + versionCheckHook, writeText, uglify-js, }: @@ -27,11 +28,14 @@ buildNpmPackage rec { dontNpmBuild = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/uglifyjs"; + passthru = { updateScript = ./update.sh; tests = { - version = testers.testVersion { package = uglify-js; }; - simple = testers.testEqualContents { assertion = "uglify-js minifies a basic js file"; expected = writeText "expected" '' diff --git a/pkgs/by-name/up/updatecli/package.nix b/pkgs/by-name/up/updatecli/package.nix index 2b509597d2d51b0..586f37e76b76f23 100644 --- a/pkgs/by-name/up/updatecli/package.nix +++ b/pkgs/by-name/up/updatecli/package.nix @@ -5,8 +5,7 @@ fetchFromGitHub, nix-update-script, installShellFiles, - testers, - updatecli, + versionCheckHook, }: buildGoModule rec { @@ -37,10 +36,6 @@ buildGoModule rec { passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - package = updatecli; - command = "updatecli version"; - }; }; nativeBuildInputs = [ installShellFiles ]; @@ -55,6 +50,11 @@ buildGoModule rec { installManPage updatecli.1 ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; + meta = with lib; { description = "Declarative Dependency Management tool"; longDescription = '' diff --git a/pkgs/by-name/up/upsun/package.nix b/pkgs/by-name/up/upsun/package.nix index b81390ffc9c18a2..2291b01dbc9ad1b 100644 --- a/pkgs/by-name/up/upsun/package.nix +++ b/pkgs/by-name/up/upsun/package.nix @@ -2,8 +2,7 @@ stdenvNoCC, lib, fetchurl, - testers, - upsun + versionCheckHook, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -44,12 +43,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru = { - tests.version = testers.testVersion { - inherit (finalAttrs) version; - package = upsun; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "Unified tool for managing your Upsun services from the command line"; diff --git a/pkgs/by-name/us/usql/package.nix b/pkgs/by-name/us/usql/package.nix index a91319183f00eae..aee0bba91abd136 100644 --- a/pkgs/by-name/us/usql/package.nix +++ b/pkgs/by-name/us/usql/package.nix @@ -4,8 +4,7 @@ , unixODBC , icu , nix-update-script -, testers -, usql +, versionCheckHook }: buildGoModule rec { @@ -54,13 +53,11 @@ buildGoModule rec { # All the checks currently require docker instances to run the databases. doCheck = false; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - inherit version; - package = usql; - command = "usql --version"; - }; }; meta = with lib; { diff --git a/pkgs/by-name/uv/uv/package.nix b/pkgs/by-name/uv/uv/package.nix index 7e209a767129529..864d0df31632d6f 100644 --- a/pkgs/by-name/uv/uv/package.nix +++ b/pkgs/by-name/uv/uv/package.nix @@ -8,9 +8,8 @@ , python3Packages , rustPlatform , stdenv -, testers -, uv , nix-update-script +, versionCheckHook }: python3Packages.buildPythonApplication rec { @@ -48,6 +47,8 @@ python3Packages.buildPythonApplication rec { darwin.apple_sdk.frameworks.SystemConfiguration ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + dontUseCmakeConfigure = true; cargoBuildFlags = [ "--package" "uv" ]; @@ -65,9 +66,6 @@ python3Packages.buildPythonApplication rec { ]; passthru = { - tests.version = testers.testVersion { - package = uv; - }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/va/vacuum-go/package.nix b/pkgs/by-name/va/vacuum-go/package.nix index cf34642df24a382..5363a7a994447da 100644 --- a/pkgs/by-name/va/vacuum-go/package.nix +++ b/pkgs/by-name/va/vacuum-go/package.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, testers, vacuum-go }: +{ lib, buildGoModule, fetchFromGitHub, versionCheckHook }: buildGoModule rec { pname = "vacuum-go"; @@ -23,13 +23,11 @@ buildGoModule rec { subPackages = [ "./vacuum.go" ]; - passthru = { - tests.version = testers.testVersion { - package = vacuum-go; - command = "vacuum version"; - version = "v${version}"; - }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/vacuum"; + versionCheckProgramArg = "version"; meta = { description = "The world's fastest OpenAPI & Swagger linter"; diff --git a/pkgs/by-name/vi/violet/package.nix b/pkgs/by-name/vi/violet/package.nix index 35e13eea544f88e..81a828d5737398a 100644 --- a/pkgs/by-name/vi/violet/package.nix +++ b/pkgs/by-name/vi/violet/package.nix @@ -4,8 +4,7 @@ fetchFromGitHub, nix-update-script, stdenv, - violet, - testers, + versionCheckHook }: stdenv.mkDerivation (finalAttrs: { @@ -22,9 +21,11 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { updateScript = nix-update-script { }; - tests = testers.testVersion { package = violet; }; }; meta = { diff --git a/pkgs/by-name/wa/wakatime-cli/package.nix b/pkgs/by-name/wa/wakatime-cli/package.nix index f465d2e301a8095..53fa1c8263bc00b 100644 --- a/pkgs/by-name/wa/wakatime-cli/package.nix +++ b/pkgs/by-name/wa/wakatime-cli/package.nix @@ -2,8 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - testers, - wakatime-cli, + versionCheckHook, }: buildGoModule rec { @@ -47,10 +46,12 @@ buildGoModule rec { in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; - passthru.tests.version = testers.testVersion { - package = wakatime-cli; - command = "HOME=$(mktemp -d) wakatime-cli --version"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + preVersionCheck = '' + export HOME=$(mktemp -d) + ''; meta = with lib; { homepage = "https://wakatime.com/"; diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix index 39044c950dced77..7fe29f329a4d498 100644 --- a/pkgs/by-name/we/werf/package.nix +++ b/pkgs/by-name/we/werf/package.nix @@ -5,8 +5,7 @@ fetchFromGitHub, installShellFiles, btrfs-progs, - testers, - werf, + versionCheckHook, }: buildGoModule rec { @@ -84,11 +83,10 @@ buildGoModule rec { --zsh <($out/bin/werf completion --shell=zsh) ''; - passthru.tests.version = testers.testVersion { - package = werf; - command = "werf version"; - version = src.rev; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgramArg = "version"; meta = with lib; { description = "GitOps delivery tool"; diff --git a/pkgs/by-name/wi/wiremock/package.nix b/pkgs/by-name/wi/wiremock/package.nix index bd830048305296d..3d007b5428e7c2b 100644 --- a/pkgs/by-name/wi/wiremock/package.nix +++ b/pkgs/by-name/wi/wiremock/package.nix @@ -5,7 +5,7 @@ lib, makeWrapper, stdenvNoCC, - testers, + versionCheckHook }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -29,11 +29,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { --add-flags "-jar $out/share/wiremock/wiremock.jar" ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.version = testers.testVersion { - command = "${lib.getExe finalAttrs.finalPackage} --version"; - package = finalAttrs.finalPackage; - }; updateScript = gitUpdater { url = "https://github.com/wiremock/wiremock.git"; ignoredVersions = "(alpha|beta|rc).*"; diff --git a/pkgs/by-name/wi/wireproxy/package.nix b/pkgs/by-name/wi/wireproxy/package.nix index b244364c8c9bf7f..f9998ba6876c2e5 100644 --- a/pkgs/by-name/wi/wireproxy/package.nix +++ b/pkgs/by-name/wi/wireproxy/package.nix @@ -1,8 +1,7 @@ { lib , buildGoModule , fetchFromGitHub -, testers -, wireproxy +, versionCheckHook }: buildGoModule rec { @@ -24,11 +23,8 @@ buildGoModule rec { vendorHash = "sha256-DNTPzZSxcjkcv7RygTpOIgdYEQ8wBPkuJqfzZGt8ExI="; - passthru.tests.version = testers.testVersion { - package = wireproxy; - command = "wireproxy --version"; - version = src.rev; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Wireguard client that exposes itself as a socks5 proxy"; diff --git a/pkgs/by-name/wi/wizer/package.nix b/pkgs/by-name/wi/wizer/package.nix index 04d4522ef3bc1df..8f5caa3acaacb16 100644 --- a/pkgs/by-name/wi/wizer/package.nix +++ b/pkgs/by-name/wi/wizer/package.nix @@ -1,8 +1,7 @@ { lib , rustPlatform , fetchFromGitHub -, testers -, wizer +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -30,9 +29,8 @@ rustPlatform.buildRustPackage rec { export HOME=$(mktemp -d) ''; - passthru.tests = { - version = testers.testVersion { package = wizer; }; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "WebAssembly pre-initializer"; diff --git a/pkgs/by-name/wl/wlx-overlay-s/package.nix b/pkgs/by-name/wl/wlx-overlay-s/package.nix index 5667cecdca1241b..678d15a3fbf8601 100644 --- a/pkgs/by-name/wl/wlx-overlay-s/package.nix +++ b/pkgs/by-name/wl/wlx-overlay-s/package.nix @@ -14,7 +14,7 @@ , pkg-config , pulseaudio , shaderc -, testers +, versionCheckHook , wayland , wlx-overlay-s , xorg @@ -74,8 +74,10 @@ rustPlatform.buildRustPackage rec { --add-needed ${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0 ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { - tests.testVersion = testers.testVersion { package = wlx-overlay-s; }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/ws/wstunnel/package.nix b/pkgs/by-name/ws/wstunnel/package.nix index 4beeef570eff770..74c52581e823094 100644 --- a/pkgs/by-name/ws/wstunnel/package.nix +++ b/pkgs/by-name/ws/wstunnel/package.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub , rustPlatform -, testers -, wstunnel +, versionCheckHook , nixosTests }: @@ -28,8 +27,10 @@ rustPlatform.buildRustPackage { "--skip=tcp::tests::test_proxy_connection" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru.tests = { - version = testers.testVersion { package = wstunnel; }; nixosTest = nixosTests.wstunnel; }; diff --git a/pkgs/by-name/xu/xunit-viewer/package.nix b/pkgs/by-name/xu/xunit-viewer/package.nix index 7c31b82aac7b3bc..e03631ff0d5e170 100644 --- a/pkgs/by-name/xu/xunit-viewer/package.nix +++ b/pkgs/by-name/xu/xunit-viewer/package.nix @@ -25,6 +25,7 @@ buildNpmPackage { passthru.updateScript = nix-update-script { }; passthru.tests = { + # TODO: maybe use `versionCheckHook`? version = testers.testVersion { package = xunit-viewer; version = "unknown"; # broken, but at least it runs diff --git a/pkgs/by-name/ya/yabai/package.nix b/pkgs/by-name/ya/yabai/package.nix index c6879884f18f31c..5f20322b3e5fe8e 100644 --- a/pkgs/by-name/ya/yabai/package.nix +++ b/pkgs/by-name/ya/yabai/package.nix @@ -5,7 +5,7 @@ fetchFromGitHub, fetchzip, installShellFiles, - testers, + versionCheckHook, writeShellScript, common-updater-scripts, curl, @@ -13,7 +13,6 @@ jq, xcodebuild, xxd, - yabai, }: let inherit (darwin.apple_sdk_11_0.frameworks) @@ -85,12 +84,10 @@ stdenv'.mkDerivation (finalAttrs: { --replace 'return screen.safeAreaInsets.top;' 'return 0;' ''; - passthru = { - tests.version = testers.testVersion { - package = yabai; - version = "yabai-v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + passthru = { sources = { # Unfortunately compiling yabai from source on aarch64-darwin is a bit complicated. We use the precompiled binary instead for now. # See the comments on https://github.com/NixOS/nixpkgs/pull/188322 for more information. diff --git a/pkgs/by-name/ya/yara-x/package.nix b/pkgs/by-name/ya/yara-x/package.nix index 81db3bed53766ec..96afd80320f9578 100644 --- a/pkgs/by-name/ya/yara-x/package.nix +++ b/pkgs/by-name/ya/yara-x/package.nix @@ -4,8 +4,7 @@ , rustPlatform , cmake , installShellFiles -, testers -, yara-x +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -30,9 +29,10 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/yr completion zsh) ''; - passthru.tests.version = testers.testVersion { - package = yara-x; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + versionCheckProgram = "${placeholder "out"}/bin/yr"; meta = { description = "Tool to do pattern matching for malware research"; diff --git a/pkgs/by-name/zo/zola/package.nix b/pkgs/by-name/zo/zola/package.nix index 2b25b1fd346b84d..a83fcdacfe86421 100644 --- a/pkgs/by-name/zo/zola/package.nix +++ b/pkgs/by-name/zo/zola/package.nix @@ -6,8 +6,7 @@ , oniguruma , darwin , installShellFiles -, zola -, testers +, versionCheckHook }: rustPlatform.buildRustPackage rec { @@ -43,7 +42,8 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/zola completion zsh) ''; - passthru.tests.version = testers.testVersion { package = zola; }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = with lib; { description = "Fast static site generator with everything built-in";