Skip to content

Commit

Permalink
ssh-import-id: refactor and move to pkgs/by-name (#350322)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 authored Oct 26, 2024
2 parents a76cb04 + b471cb4 commit 1b5a473
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 46 deletions.
63 changes: 63 additions & 0 deletions pkgs/by-name/ss/ssh-import-id/package.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
44 changes: 0 additions & 44 deletions pkgs/tools/admin/ssh-import-id/default.nix

This file was deleted.

2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit 1b5a473

Please sign in to comment.