Declarative Printer Setup Missing Driver

Hello Nix Wizards

I got this engenious setup from Mr. Hoeg here on the forum: https://discourse.nixos.org/t/brother-dcp-572dw-wrapper/8113/3

It works so far for me. Only problem is, that model = "everywhere"; does setup my printer to only grayscale.
So I changed to model = "drv:///cupsfilters.drv/pwgrast.ppd";, this is also not perfect as the two sided printing does not work correctly. As drv:///cupsfilters.drv/pwgrast.ppd is some general driver.

When I manually change the driver to everywhere in the HP driver menu then everything works:

How can I find this driver and apply it correctly to model = "everywhere";?

Thank you in advance for your answer!

Here’s the whole shebang:

{ config, lib, pkgs, ... }:

# check existing printers with lpstat -s and remove printers with lpadmin -x <printer-name>

{
  hardware =
    let
      printer = "HP_Color_LaserJet_Pro_M454dw";
      hostName = "192.168.178.3";
    in
      {
        printers = {
          ensureDefaultPrinter = printer;
          ensurePrinters = [
            {
              name = printer;
              deviceUri = "ipp://${hostName}";
              model = "drv:///cupsfilters.drv/pwgrast.ppd";  # Location of the ppd driver file for the printer. lpinfo -m shows a list of supported models.
              description = lib.replaceStrings [ "_" ] [ " " ] printer;
              location = "Home";
            }
          ];
        };
      };
}

I suggest taking a look at /etc/cups/printers.conf to see what the difference is between what the nixos module does (it should have created a systemd service named ensure-printers.service) and what you did manually.

1 Like

Thank you Peter! Will check it out …