diff --git a/pkgs/tools/inputmethods/input-remapper/default.nix b/pkgs/tools/inputmethods/input-remapper/default.nix index 719953dc2c7e..6a27efe55775 100644 --- a/pkgs/tools/inputmethods/input-remapper/default.nix +++ b/pkgs/tools/inputmethods/input-remapper/default.nix @@ -20,6 +20,7 @@ gtksourceview4, bash, udevCheckHook, + versionCheckHook, nixosTests, # Change the default log level to debug for easier debugging of package issues withDebugLogLevel ? false, @@ -66,7 +67,6 @@ in glib gobject-introspection pygobject3 - udevCheckHook ] ++ maybeXmodmap; @@ -81,9 +81,14 @@ in psutil ]; - doCheck = withDoCheck; + # buildPythonApplication maps nativeCheckInputs to nativeInstallCheckInputs. + nativeCheckInputs = [ + udevCheckHook + versionCheckHook + ] + ++ lib.optionals withDoCheck [ psutil ]; - nativeCheckInputs = [ psutil ]; + versionCheckProgram = "${placeholder "out"}/bin/input-remapper-control"; pythonImportsCheck = [ "evdev" @@ -115,9 +120,7 @@ in # We only run tests in the unit folder, integration tests require UI # To allow tests which access the system and session DBUS to run, we start a dbus session # and bind it to both the system and session buses - installCheckPhase = '' - runHook preInstallCheck - + upstreamCheck = lib.optionalString withDoCheck '' echo " session unix:tmpdir=$TMPDIR @@ -145,7 +148,11 @@ in DBUS_SYSTEM_BUS_ADDRESS=unix:path=/build/system_bus_socket \ ${dbus}/bin/dbus-run-session --config-file dbus.cfg \ python tests/test.py --start-dir unit + ''; + installCheckPhase = '' + runHook preInstallCheck + eval "$upstreamCheck" runHook postInstallCheck '';