ssh-import-id: refactor and move to pkgs/by-name (#350322)

This commit is contained in:
Maciej Krüger
2024-10-26 22:26:50 +02:00
committed by GitHub
3 changed files with 63 additions and 46 deletions
+63
View File
@@ -0,0 +1,63 @@
{
lib,
extraHandlers ? [ ],
fetchgit,
installShellFiles,
makeWrapper,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "ssh-import-id";
version = "5.11";
pyproject = true;
src = fetchgit {
url = "https://git.launchpad.net/ssh-import-id";
rev = "refs/tags/${version}";
hash = "sha256-tYbaJGH59qyvjp4kwo3ZFVs0EaE0Lsd2CQ6iraFkAdI=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "long_description_content_type='markdown'" "long_description_content_type='text/markdown'"
'';
build-system = with python3Packages; [ setuptools ];
nativeBuildInputs = [
makeWrapper
installShellFiles
];
dependencies =
with python3Packages;
[
requests
distro
]
++ extraHandlers;
postInstall = ''
installManPage $src/usr/share/man/man1/ssh-import-id.1
'';
# Handlers require main bin, main bin requires handlers
makeWrapperArgs = [
"--prefix"
":"
"$out/bin"
];
meta = with lib; {
description = "Retrieves an SSH public key and installs it locally";
homepage = "https://launchpad.net/ssh-import-id";
license = licenses.gpl3Only;
maintainers = with maintainers; [
mkg20001
viraptor
];
mainProgram = "ssh-import-id";
platforms = platforms.unix;
};
}
@@ -1,44 +0,0 @@
{ buildPythonPackage
, lib
, fetchgit
, requests
, distro
, makeWrapper
, installShellFiles
, extraHandlers ? []
}:
buildPythonPackage rec {
pname = "ssh-import-id";
version = "5.11";
src = fetchgit {
url = "https://git.launchpad.net/ssh-import-id";
rev = version;
sha256 = "sha256-tYbaJGH59qyvjp4kwo3ZFVs0EaE0Lsd2CQ6iraFkAdI=";
};
propagatedBuildInputs = [
requests
distro
] ++ extraHandlers;
nativeBuildInputs = [
makeWrapper
installShellFiles
];
postInstall = ''
installManPage $src/usr/share/man/man1/ssh-import-id.1
'';
# handlers require main bin, main bin requires handlers
makeWrapperArgs = [ "--prefix" ":" "$out/bin" ];
meta = with lib; {
description = "Retrieves an SSH public key and installs it locally";
license = licenses.gpl3;
maintainers = with maintainers; [ mkg20001 viraptor ];
platforms = platforms.unix;
};
}
-2
View File
@@ -3842,8 +3842,6 @@ with pkgs;
ssh-agents = callPackage ../tools/networking/ssh-agents { };
ssh-import-id = python3Packages.callPackage ../tools/admin/ssh-import-id { };
ssh-key-confirmer = callPackage ../tools/networking/ssh-key-confirmer { };
ssh-mitm = callPackage ../tools/security/ssh-mitm { };