1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{ depot, pkgs, ... }:
# videoDevice is a string, e.g. "/dev/video0"
{ videoDevice }:

let
  inherit (depot.nix) writeExecline getBins;
  bins = getBins pkgs.zbar [ "zbarcam" ];

in writeExecline "read-qr-code-from-camera" {} [
  bins.zbarcam
    "-Sbinary"
    "--oneshot"
    "--raw"
    videoDevice
]