52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{
|
|
description = "zig-hidapi";
|
|
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "nixpkgs/nixos-unstable";
|
|
};
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
};
|
|
zig = {
|
|
url = "github:mitchellh/zig-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
nixpkgs,
|
|
flake-utils,
|
|
zig,
|
|
...
|
|
}: let
|
|
in
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
name = "zig-hidapi";
|
|
nativeBuildInputs = [
|
|
pkgs.hidapi
|
|
zig.packages.${system}.master
|
|
];
|
|
buildInputs = [
|
|
pkgs.hidapi
|
|
];
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
|
|
pkgs.hidapi
|
|
];
|
|
};
|
|
packages.default = pkgs.zigStdenv.mkDerivation {
|
|
pname = "zig-hidapi";
|
|
version = "0.1.0";
|
|
buildInputs = [pkgs.hidapi];
|
|
src = ./.;
|
|
};
|
|
}
|
|
);
|
|
}
|