diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 6bb268d21995..12d2ea182af0 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -117,6 +117,10 @@ buildPythonPackage rec { multimediaEnabled = withMultimedia; webKitEnabled = withWebKit; WebSocketsEnabled = withWebSockets; + connectivityEnabled = withConnectivity; + locationEnabled = withLocation; + serialPortEnabled = withSerialPort; + toolsEnabled = withTools; }; dontConfigure = true; diff --git a/pkgs/development/python-modules/pyqt5-stubs/default.nix b/pkgs/development/python-modules/pyqt5-stubs/default.nix new file mode 100644 index 000000000000..505c64253971 --- /dev/null +++ b/pkgs/development/python-modules/pyqt5-stubs/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, pyqt5 +, pyqt3d +, pyqtchart +, pyqtdatavisualization +, pyqtwebengine +}: + +buildPythonPackage rec { + pname = "PyQt5-stubs"; + version = "5.15.6.0"; + format = "setuptools"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "python-qt-tools"; + repo = "PyQt5-stubs"; + rev = version; + hash = "sha256-qWnvlHnFRy8wbZJ28C0pYqAxod623Epe5z5FZufheDc="; + }; + postPatch = '' + # pulls in a dependency to mypy, but we don't want to run linters + rm tests/test_stubs.py + '' + lib.optionalString (!pyqt5.connectivityEnabled) '' + rm tests/qflags/test_QtBluetooth_* + rm tests/qflags/test_QtNfc_* + '' + lib.optionalString (!pyqt5.locationEnabled) '' + rm tests/qflags/test_QtLocation_* + rm tests/qflags/test_QtPositioning_* + '' + lib.optionalString (!pyqt5.multimediaEnabled) '' + rm tests/qflags/test_QtMultimedia_* + '' + lib.optionalString (!pyqt5.serialPortEnabled) '' + rm tests/qflags/test_QtSerialPort_* + '' + lib.optionalString (!pyqt5.toolsEnabled) '' + rm tests/qflags/test_QtDesigner_* + ''; + + pythonImportsCheck = [ + "PyQt5-stubs" + ]; + + nativeCheckInputs = [ + pytestCheckHook + pyqt5 + pyqt3d + pyqtchart + pyqtdatavisualization + pyqtwebengine + ]; + + meta = with lib; { + description = "Stubs for PyQt5 "; + homepage = "https://github.com/python-qt-tools/PyQt5-stubs"; + license = licenses.gpl3; + maintainers = with maintainers; [ _999eagle ]; + }; +} diff --git a/pkgs/development/python-modules/qt-material/default.nix b/pkgs/development/python-modules/qt-material/default.nix new file mode 100644 index 000000000000..c7c195cdfc48 --- /dev/null +++ b/pkgs/development/python-modules/qt-material/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, jinja2 +}: + +buildPythonPackage rec { + pname = "qt-material"; + version = "2.14"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-tdu1relyF8964za7fAR8kL6zncfyBIpJjJFq1fL3riM="; + }; + + propagatedBuildInputs = [ + jinja2 + ]; + + pythonImportsCheck = [ + "qt_material" + ]; + + meta = with lib; { + description = "Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6"; + homepage = "https://github.com/UN-GCPDS/qt-material"; + license = licenses.bsd2; + maintainers = with maintainers; [ _999eagle ]; + }; +} diff --git a/pkgs/tools/security/nitrokey-app2/default.nix b/pkgs/tools/security/nitrokey-app2/default.nix new file mode 100644 index 000000000000..935838a5d60a --- /dev/null +++ b/pkgs/tools/security/nitrokey-app2/default.nix @@ -0,0 +1,51 @@ +{ lib +, python3 +, fetchFromGitHub +, pynitrokey +, wrapQtAppsHook +}: + +python3.pkgs.buildPythonApplication rec { + pname = "nitrokey-app2"; + version = "2.1.2"; + format = "flit"; + + src = fetchFromGitHub { + owner = "Nitrokey"; + repo = "nitrokey-app2"; + rev = "v${version}"; + hash = "sha256-VyhIFNXxH/FohgjhBeZXoQYppP7PEz+ei0qzsWz1xhk="; + }; + + preBuild = '' + make build-ui + ''; + + nativeBuildInputs = with python3.pkgs; [ + pyqt5 + wrapQtAppsHook + ]; + + dontWrapQtApps = true; + + propagatedBuildInputs = with python3.pkgs; [ + pynitrokey + pyudev + pyqt5 + pyqt5-stubs + qt-material + ]; + + preFixup = '' + wrapQtApp "$out/bin/nitrokeyapp" \ + --set-default CRYPTOGRAPHY_OPENSSL_NO_LEGACY 1 + ''; + + meta = with lib; { + description = "This application allows to manage Nitrokey 3 devices"; + homepage = "https://github.com/Nitrokey/nitrokey-app2"; + license = licenses.asl20; + maintainers = with maintainers; [ _999eagle ]; + mainProgram = "nitrokeyapp"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2cb9248efda4..39458901bb7b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -41870,6 +41870,8 @@ with pkgs; nitrokey-app = libsForQt5.callPackage ../tools/security/nitrokey-app { }; + nitrokey-app2 = libsForQt5.callPackage ../tools/security/nitrokey-app2 { }; + fpm2 = callPackage ../tools/security/fpm2 { }; simplenote = callPackage ../applications/misc/simplenote { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 84c900aa0ef9..2eeed1626a1c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10600,6 +10600,8 @@ self: super: with self; { pyqt5 = callPackage ../development/python-modules/pyqt/5.x.nix { }; + pyqt5-stubs = callPackage ../development/python-modules/pyqt5-stubs { }; + pyqt5_sip = callPackage ../development/python-modules/pyqt/sip.nix { }; pyqt5_with_qtmultimedia = self.pyqt5.override { @@ -11821,6 +11823,8 @@ self: super: with self; { qstylizer = callPackage ../development/python-modules/qstylizer { }; + qt-material = callPackage ../development/python-modules/qt-material { }; + qt5reactor = callPackage ../development/python-modules/qt5reactor { }; qt6 = pkgs.qt6.override {