2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, python3
|
|
|
|
, fetchPypi
|
|
|
|
, rustPlatform
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
# https://github.com/nxp-mcuxpresso/spsdk/issues/64
|
|
|
|
cryptography = super.cryptography.overridePythonAttrs (old: rec {
|
|
|
|
version = "41.0.7";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit (old) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-E/k86b6oAWwlOzSvxr1qdZk+XEBnLtVAWpyDLw1KALw=";
|
|
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = "${old.pname}-${version}/${old.cargoRoot}";
|
|
|
|
name = "${old.pname}-${version}";
|
|
|
|
hash = "sha256-VeZhKisCPDRvmSjGNwCgJJeVj65BZ0Ge+yvXbZw86Rw=";
|
|
|
|
};
|
|
|
|
patches = [ ];
|
|
|
|
doCheck = false; # would require overriding cryptography-vectors
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "nitrokey-app2";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.1.5";
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = python.pythonOlder "3.9";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Nitrokey";
|
|
|
|
repo = "nitrokey-app2";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-mR13zUgCdNS09EnpGLrnOnoIn3p6ZM/0fHKg0OUMWj4=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
# https://github.com/Nitrokey/nitrokey-app2/issues/152
|
|
|
|
#
|
|
|
|
# pythonRelaxDepsHook does not work here, because it runs in postBuild and
|
|
|
|
# only modifies the dependencies in the built distribution.
|
|
|
|
postPatch = ''
|
2024-01-25 14:12:00 +00:00
|
|
|
substituteInPlace pyproject.toml --replace 'pynitrokey = "' 'pynitrokey = ">='
|
2023-10-19 13:55:26 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
2024-01-25 14:12:00 +00:00
|
|
|
poetry-core
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2023-10-09 19:29:22 +00:00
|
|
|
pynitrokey
|
|
|
|
pyudev
|
2024-01-25 14:12:00 +00:00
|
|
|
pyside6
|
2023-10-09 19:29:22 +00:00
|
|
|
qt-material
|
|
|
|
];
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"nitrokeyapp"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "This application allows to manage Nitrokey 3 devices";
|
|
|
|
homepage = "https://github.com/Nitrokey/nitrokey-app2";
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://github.com/Nitrokey/nitrokey-app2/releases/tag/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
license = licenses.asl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ _999eagle panicgh ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "nitrokeyapp";
|
|
|
|
};
|
|
|
|
}
|