- Delete lib/examples/ (unused upstream leftovers) - Remove rusb crate dependency - Define local Direction enum in consts.rs (Out=0x00, In=0x80) - Remove RusbUsbHostInterfaceHandler and RusbUsbHostDeviceHandler - Replace rusb device enumeration with nusb in new_from_host* - Update flake.nix cargoHash and Cargo.lock Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
62 lines
1.4 KiB
Nix
62 lines
1.4 KiB
Nix
{
|
|
description = "USB/IP server library and CLI tool";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
rustc
|
|
cargo
|
|
rustfmt
|
|
clippy
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
libusb1
|
|
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
|
udev
|
|
];
|
|
|
|
usbip-rs = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "usbip-rs";
|
|
version = "0.8.0";
|
|
|
|
src = self;
|
|
|
|
cargoHash = "sha256-i2dRJ7n7J9K2PfjEUnIPS9pRXs61WUYYXAfJUmFxt/M=";
|
|
|
|
inherit nativeBuildInputs buildInputs;
|
|
|
|
buildFeatures = [ "usbip-rs/serde" ];
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "USB/IP server library and CLI tool";
|
|
homepage = "https://github.com/jiegec/usbip";
|
|
license = licenses.mit;
|
|
mainProgram = "usbip-rs";
|
|
};
|
|
};
|
|
in
|
|
{
|
|
packages = {
|
|
default = usbip-rs;
|
|
inherit usbip-rs;
|
|
};
|
|
|
|
checks = {
|
|
default = usbip-rs;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit nativeBuildInputs buildInputs;
|
|
};
|
|
});
|
|
}
|