fix: lw5xl install process, add: HP Deskjet 2800

This commit is contained in:
♥ Minnie ♥ 2024-09-02 21:15:13 +08:00
parent 69eff28b09
commit 2fce9fd507
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
4 changed files with 35 additions and 13 deletions

View file

@ -1,17 +1,29 @@
{pkgs, ...}: { {pkgs, ...}: {
hardware.printers = { hardware.printers = {
ensurePrinters = [ ensurePrinters = [
{
name = "HP_DeskJet_2800_series_276B08";
description = "HP DeskJet 2800 series";
location = "Local Printer";
deviceUri = "dnssd://HP%20DeskJet%202800%20series%20%5B276B08%5D._ipp._tcp.local/?uuid=5e8778d6-018e-48ec-8838-c8cf40170b95";
model = "drv:///hp/hpcups.drv/hp-Deskjet_2800_series.ppd";
ppdOptions = {
PageSize = "A4";
};
}
{ {
name = "DYMO_Label_Writer_5XL_on_DYMOLW5XL315c26E"; name = "DYMO_Label_Writer_5XL_on_DYMOLW5XL315c26E";
description = "DYMO LabelWriter 5XL"; description = "DYMO LabelWriter 5XL";
location = "Local Printer";
deviceUri = "dnssd://DYMO%20Label%20Writer%205XL%20on%20DYMOLW5XL315c26E._pdl-datastream._tcp.local/"; deviceUri = "dnssd://DYMO%20Label%20Writer%205XL%20on%20DYMOLW5XL315c26E._pdl-datastream._tcp.local/";
model = "lw5xl.ppd"; model = "53hwxkc5kmnm06xvkx8f6w3dcsh7jlhg-lw5xl.ppd";
ppdOptions = { ppdOptions = {
DymoPrintQuality = "Graphics"; DymoPrintQuality = "Graphics";
}; };
} }
]; ];
ensureDefaultPrinter = "DYMO_Label_Writer_5XL_on_DYMOLW5XL315c26E"; ensureDefaultPrinter = "HP_DeskJet_2800_series_276B08";
}; };
services.avahi = { services.avahi = {
@ -23,8 +35,8 @@
services.printing = { services.printing = {
enable = true; enable = true;
drivers = [ drivers = [
pkgs.cups-dymo pkgs.hplipWithPlugin
(pkgs.writeTextDir "share/cups/model/lw5xl.ppd" (builtins.readFile ./lw5xl.ppd)) (pkgs.callPackage ./lw5xl.nix {})
]; ];
}; };
} }

View file

@ -0,0 +1,18 @@
{stdenv}: let
lw5xl = ./lw5xl.ppd;
raster2dymolw_v2 = ./raster2dymolw_v2;
in
stdenv.mkDerivation rec {
name = "lw5xw-${version}";
version = "1.0";
src = ./.;
installPhase = ''
mkdir -p $out/share/cups/model/
cp ${lw5xl} $out/share/cups/model/
mkdir -p $out/lib/cups/filter/
cp ${raster2dymolw_v2} $out/lib/cups/filter/raster2dymolw_v2
'';
}

View file

@ -1,7 +1,5 @@
# This file defines overlays # This file defines overlays
{inputs, ...}: let {inputs, ...}: {
raster2dymolw_v2 = ./raster2dymolw_v2;
in {
# This one brings our custom packages from the 'pkgs' directory # This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs; additions = final: _prev: import ../pkgs final.pkgs;
@ -12,12 +10,6 @@ in {
# example = prev.example.overrideAttrs (oldAttrs: rec { # example = prev.example.overrideAttrs (oldAttrs: rec {
# ... # ...
# }); # });
cups-dymo = prev.cups-dymo.overrideAttrs (oldAttrs: {
installPhase = ''
installPhase
cp ${raster2dymolw_v2} $out/lib/cups/filter/raster2dymolw_v2
'';
});
}; };
# When applied, the unstable nixpkgs set (declared in the flake inputs) will # When applied, the unstable nixpkgs set (declared in the flake inputs) will