1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 perl,
6 openssh,
7 kmod,
8 makeWrapper,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "usbip-ssh";
13 version = "0-unstable-2024-10-09";
14
15 src = fetchFromGitHub {
16 owner = "turistu";
17 repo = "usbip-ssh";
18 rev = "1b38f2d7854048bf6129ffe992f3c9caa630e377";
19 hash = "sha256-3kGGMlIMTXnBVLgsZijc0yLbyaZZSDf7lr46mg0viWw=";
20 };
21
22 nativeBuildInputs = [
23 makeWrapper
24 ];
25
26 buildInputs = [
27 perl
28 ];
29
30 installPhase = ''
31 runHook preInstall
32 install -Dm755 usbip-ssh -t $out/bin
33 runHook postInstall
34 '';
35
36 postInstall = ''
37 wrapProgram $out/bin/usbip-ssh --prefix PATH : ${
38 lib.makeBinPath [
39 perl
40 openssh
41 kmod
42 ]
43 }
44 '';
45
46 meta = {
47 homepage = "https://github.com/turistu/usbip-ssh";
48 description = "Import usb devices from another linux machine with ssh's connection forwarding mechanism";
49 license = lib.licenses.gpl3Only;
50 maintainers = with lib.maintainers; [ kagehisa ];
51 mainProgram = "usbip-ssh";
52 platforms = lib.platforms.linux;
53 };
54})