From 7be9e416572da6c0a690902ba8b95bd3108fdf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 12 Sep 2023 20:10:55 +0200 Subject: [PATCH] fix: add support for QL-800 --- hosts/chocolatebar/chocolatebar.nix | 4 ++++ modules/printing/default.nix | 1 - pkgs/print-label.nix | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 pkgs/print-label.nix diff --git a/hosts/chocolatebar/chocolatebar.nix b/hosts/chocolatebar/chocolatebar.nix index e8fddf4..6de9a7c 100644 --- a/hosts/chocolatebar/chocolatebar.nix +++ b/hosts/chocolatebar/chocolatebar.nix @@ -75,6 +75,10 @@ in { pkgs.cups-brother-hl3140cw ]; + services.udev.extraRules = '' + SUBSYSTEMS=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="209e", ATTRS{serial}=="000W0H924252", MODE="0664", GROUP="lp", SYMLINK+="usb/lp0" + ''; + home-manager.users."${psCfg.user.name}" = { xdg.configFile = mkIf psCfg.sway.enable { "sway/config.d/10-autostart.conf".source = ./.config/sway/config.d/autostart.conf; diff --git a/modules/printing/default.nix b/modules/printing/default.nix index 168df5f..2dc9d03 100644 --- a/modules/printing/default.nix +++ b/modules/printing/default.nix @@ -27,7 +27,6 @@ in { ]; hardware.sane = { enable = true; - brscan4.enable = true; extraBackends = [pkgs.hplipWithPlugin]; }; }; diff --git a/pkgs/print-label.nix b/pkgs/print-label.nix new file mode 100644 index 0000000..130a255 --- /dev/null +++ b/pkgs/print-label.nix @@ -0,0 +1,6 @@ +self: +with self; '' + TMPDIR=${coreutils}/bin/mktemp + echo "ASN#$1" > "$TMPDIR/input.txt" + ${imagemagick}/bin/convert -size 696x64 xc:white -font "FreeMono" -pointsize 48 -fill black -annotate +16+48 "@$TMPDIR/input.txt" test.png +''