Profpatsch/users/Profpatsch/read-qr-code.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{ depot, pkgs, ... }:

let
  inherit (depot.nix) writeExecline getBins;
  bins = getBins pkgs.zbar [ "zbarimg" ]
      // getBins pkgs.imagemagick [ "import" ];

in writeExecline "read-qr-code" {} [
  "pipeline" [
    bins.import "png:-"
  ]
  bins.zbarimg
    "-Sbinary"
    "-Sdisable"
    "-Sqrcode.enable"
    "--raw"
    "-"
]