2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
installShellFiles,
|
|
|
|
python3,
|
2022-05-18 14:49:53 +00:00
|
|
|
}:
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
|
|
|
py = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = py;
|
2023-05-24 13:37:59 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
paramiko = super.paramiko.overridePythonAttrs (oldAttrs: rec {
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "3.3.1";
|
2023-05-24 13:37:59 +00:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-ajd3qWGshtvvN1xfW41QAUoaltD9fwVKQ7yIATSw/3c=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "Use-pytest-s-setup_method-in-pytest-8-the-nose-method-setup-is-deprecated.patch";
|
|
|
|
url = "https://github.com/paramiko/paramiko/pull/2349.diff";
|
|
|
|
hash = "sha256-4CTIZ9BmzRdh+HOwxSzfM9wkUGJOnndctK5swqqsIvU=";
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ python3.pkgs.icecream ];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildPythonApplication rec {
|
2022-05-18 14:49:53 +00:00
|
|
|
pname = "ssh-mitm";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "4.1.1";
|
|
|
|
pyproject = true;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-06-05 15:53:02 +00:00
|
|
|
owner = "ssh-mitm";
|
|
|
|
repo = "ssh-mitm";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-Uf1B7oEZyNWj4TjrLvEfFdxsvsGeMLXFsSdxGLUV4ZU=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [
|
|
|
|
hatchling
|
|
|
|
hatch-requirements-txt
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-12-28 21:21:41 +00:00
|
|
|
argcomplete
|
2022-05-18 14:49:53 +00:00
|
|
|
colored
|
|
|
|
packaging
|
|
|
|
paramiko
|
|
|
|
pytz
|
|
|
|
pyyaml
|
2024-06-05 15:53:02 +00:00
|
|
|
python-json-logger
|
2022-05-18 14:49:53 +00:00
|
|
|
rich
|
2024-06-05 15:53:02 +00:00
|
|
|
tkinter
|
2023-05-24 13:37:59 +00:00
|
|
|
setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
sshpubkeys
|
2024-06-05 15:53:02 +00:00
|
|
|
wrapt
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ setuptools ];
|
|
|
|
# fix for darwin users
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
# Module has no tests
|
|
|
|
doCheck = false;
|
2024-06-05 15:53:02 +00:00
|
|
|
# Install man page
|
|
|
|
postInstall = ''
|
|
|
|
installManPage man1/*
|
|
|
|
'';
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "sshmitm" ];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Tool for SSH security audits";
|
|
|
|
homepage = "https://github.com/ssh-mitm/ssh-mitm";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/ssh-mitm/ssh-mitm/blob/${version}/CHANGELOG.md";
|
|
|
|
license = licenses.gpl3Only;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|