Add qrclip convenience script

This commit is contained in:
Sam W 2022-03-10 16:32:40 +00:00
parent 808d352c49
commit 6eff89f48a
3 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ pkgs, lib, ... }: {
# Mac specific packages.
# TODO: have this in a central packages place rather than here
home.packages = with pkgs; [ pngpaste ];
home.packages = with pkgs; [ pngpaste mypkgs.qrclip ];
# Use secretive for SSH agent
programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin {
host = "*";

View File

@ -1,3 +1,4 @@
# TODO: auto import everything
{ pkgs }:
{ }
{ pkgs }: {
qrclip = pkgs.callPackage ./qrclip { };
}

5
pkgs/qrclip/default.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs }:
pkgs.writeShellScriptBin "qrclip" ''
set -eo pipefail
${pkgs.pngpaste}/bin/pngpaste - | ${pkgs.zbar}/bin/zbarimg --raw -q1 -
''