diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f241bbacbb07..b4a42f031ea5 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14211,6 +14211,13 @@ githubId = 9920871; name = "Monotoko"; }; + ktemkin = { + email = "kate@ktemk.in"; + github = "ktemkin"; + githubId = 1298105; + name = "Kate Temkin"; + matrix = "@ktemkin:katesiria.org"; + }; ktf = { email = "giulio.eulisse@cern.ch"; github = "ktf"; diff --git a/pkgs/by-name/yk/ykush/99-ykush.rules b/pkgs/by-name/yk/ykush/99-ykush.rules new file mode 100644 index 000000000000..34cfc1e87a57 --- /dev/null +++ b/pkgs/by-name/yk/ykush/99-ykush.rules @@ -0,0 +1,14 @@ +# Yepkit YKUSH3. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f11b", MODE="0666" + +# Yepkit YKUSH2. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="efed", MODE="0666" + +# Yepkit YKUSHXs +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f0cd", MODE="0666" + +# Yepkit YKUSH(1). +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f2f7", MODE="0666" + +# Yepkit YKUSH-legacy. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="0042", MODE="0666" diff --git a/pkgs/by-name/yk/ykush/package.nix b/pkgs/by-name/yk/ykush/package.nix new file mode 100644 index 000000000000..778f19deee39 --- /dev/null +++ b/pkgs/by-name/yk/ykush/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchFromGitHub, + libusb1, + runCommand, + versionCheckHook, +}: +stdenv.mkDerivation (final: { + pname = "ykushcmd"; + version = "1.2.5"; + + buildInputs = [ libusb1 ]; + + src = fetchFromGitHub { + owner = "yepkit"; + repo = "ykush"; + tag = "${final.version}"; + hash = "sha256-FbqlXh8A5hzpthBE3jZ1LLOMs4WcEGke3sOZi9vmZF8="; + }; + + installPhase = '' + runHook preInstall + + install -D bin/ykushcmd $out/bin/ykushcmd + install -Dm444 ${./99-ykush.rules} $out/lib/udev/rules.d/99_ykush.rules + + runHook postInstall + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + passthru.tests = { + # We can't run any actual tests without hardware, but we can at least check the binary. + run-only = runCommand "${final.pname}-test" '' + ${final}/bin/ykushcmd -h | grep YKUSHCMD + ''; + }; + + meta = { + description = "Control utility for YepKit USB hubs"; + longDescription = '' + controls the features of YepKit USB hubs, allowing one to arbitrarily + turn ports on and off and otherwise control the hub. + ''; + homepage = "https://github.com/Yepkit/ykush"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + aiyion + ktemkin + ]; + mainProgram = "ykushcmd"; + platforms = lib.platforms.linux; + }; +})