initial version

This commit is contained in:
Robin Appelman 2025-09-18 02:31:49 +02:00
commit e37160b717
11 changed files with 2800 additions and 3 deletions

26
nix/package.nix Normal file
View file

@ -0,0 +1,26 @@
{
rustPlatform,
pkg-config,
lib,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?" ".*\.rules"];
version = (fromTOML (readFile ../Cargo.toml)).package.version;
in
rustPlatform.buildRustPackage rec {
pname = "ptouch-api";
inherit src version;
cargoLock = {
lockFile = ../Cargo.lock;
};
postInstall = ''
mkdir -p $out/lib/udev/rules.d/
cp ./51-ptouch-api.rules $out/lib/udev/rules.d/
'';
meta.mainProgram = "ptouch-api";
}