diff options
author | 7c6f434c <7c6f434c@mail.ru> | 2024-01-10 16:30:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 16:30:59 +0000 |
commit | be0e0e59711b1aee855701c2e7ce469546ca1334 (patch) | |
tree | da7f7302fd1596d1eb2f47196d90d81faeae85df | |
parent | 05bb4f6eb197138910e34476ac771ac2e205036d (diff) | |
parent | cd40955a023aa9b68afe3ef7d2ea42eefc1b43fc (diff) |
Merge pull request #279488 from mevatron/pr-add-ebpf-usb
Add ebpf-usb python application
-rw-r--r-- | maintainers/maintainer-list.nix | 6 | ||||
-rw-r--r-- | pkgs/by-name/eb/ebpf-usb/package.nix | 48 |
2 files changed, 54 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e2b68cb52cd8a..00a362698ed58 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11902,6 +11902,12 @@ github = "Mephistophiles"; githubId = 4850908; }; + mevatron = { + email = "mevatron@gmail.com"; + name = "mevatron"; + github = "mevatron"; + githubId = 714585; + }; mfossen = { email = "msfossen@gmail.com"; github = "mfossen"; diff --git a/pkgs/by-name/eb/ebpf-usb/package.nix b/pkgs/by-name/eb/ebpf-usb/package.nix new file mode 100644 index 0000000000000..a4da98ee7fb54 --- /dev/null +++ b/pkgs/by-name/eb/ebpf-usb/package.nix @@ -0,0 +1,48 @@ +{ lib +, fetchFromGitHub +, python3Packages +, bcc +}: + +python3Packages.buildPythonApplication rec { + pname = "ebpf-usb"; + version = "unstable-2022-04-03"; + pyproject = false; + + src = fetchFromGitHub { + owner = "francisrstokes"; + repo = "ebpf-usb"; + rev = "3ab6f0d8c6ece51bbb5cc5e05daa4008eccd70e8"; + hash = "sha256-n3ttFej9sroTqAOgyAejwKT+aMt/z7HlVPV6CVGPNUQ="; + }; + + makeWrapperArgs = [ + "--set PYTHONUNBUFFERED 1" + ]; + + pythonPath = [ bcc ] ++ (with python3Packages; [ + hexdump + ]); + + postPatch = '' + substituteInPlace ebpf-usb.py \ + --replace '#!/usr/bin/env -S python3 -u' '#!/usr/bin/env python3' + ''; + + installPhase = '' + runHook preInstall + install -Dm755 ebpf-usb.py $out/bin/ebpf-usb + runHook postInstall + ''; + + # no tests + doCheck = false; + + meta = with lib; { + description = "A Python script for USB monitoring using eBPF"; + homepage = "https://github.com/francisrstokes/ebpf-usb"; + license = lib.licenses.unfree; + maintainers = with maintainers; [ mevatron ]; + mainProgram = "ebpf-usb"; + }; +} |