mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
47 lines
939 B
Nix
47 lines
939 B
Nix
{
|
|
stdenvNoCC,
|
|
makeWrapper,
|
|
barcodebuddy,
|
|
barcodebuddy-scanner,
|
|
screen,
|
|
lib,
|
|
enableRequests ? true,
|
|
enablePhp ? false,
|
|
php,
|
|
python3,
|
|
...
|
|
}: let
|
|
inherit (lib.lists) optional optionals;
|
|
inherit (lib.strings) makeBinPath;
|
|
python = python3.withPackages (
|
|
p:
|
|
[p.evdev]
|
|
++ optional enableRequests p.requests
|
|
);
|
|
in
|
|
stdenvNoCC.mkDerivation {
|
|
pname = "barcodebuddy-scanner.py";
|
|
inherit (barcodebuddy) version src;
|
|
inherit (barcodebuddy-scanner) patches meta;
|
|
|
|
skipConfigure = true;
|
|
skipBuild = true;
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
];
|
|
|
|
buildInputs = [python];
|
|
|
|
scannerPath = makeBinPath (
|
|
optionals enablePhp [screen php]
|
|
);
|
|
${
|
|
if enablePhp
|
|
then "barcodebuddyScript"
|
|
else null
|
|
} = "${barcodebuddy}/index.php";
|
|
|
|
scannerSource = "example/grabInput.py";
|
|
inherit (barcodebuddy-scanner) installPhase postInstall;
|
|
}
|