Printing: Difference between revisions

imported>Chuangzhu
use stable nix-shell cli, use sudo -E to pass all envvars so it works on wayland
imported>Symphorien
make driverless priting more prominent, add usb case
Line 1: Line 1:
==Basic configuration==
==IPP everywhere capable printer==


Most modern printers are capable of the IPP everywhere protocol, ie printing without installing drivers. This is notably the case of all WiFi printers marketed as Apple-compatible ([https://support.apple.com/en-ca/HT201311 list]).
Add to <code>/etc/nixos/configuration.nix</code>:
<syntaxhighlight lang="nix">
{
  ...
  services.printing.enable = true;
  services.avahi.enable = true;
  # for a WiFi printer
  services.avahi.openFirewall = true;
  # for an USB printer
  services.ipp-usb.enable = true;
  ...
}
</syntaxhighlight>
After running <code>nixos-rebuild switch</code>, detected printers should appear automatically.
== Driver-based printing ==
<ol><li>Add to <code>/etc/nixos/configuration.nix</code>:
<ol><li>Add to <code>/etc/nixos/configuration.nix</code>:


Line 11: Line 30:
}
}
</syntaxhighlight>
</syntaxhighlight>
where <code>YOUR_DRIVER</code> is the driver package appropriate for your printer. Note that nowadays nearly all printers support the "IPP Everywhere" protocol (so no need for additional drivers, just select it when you install your printer in the "Generic > IPP everywhere" section… note that the list may not be perfectly alphabetically sorted). Note that for the scanner functionality, there is a similar driver-less backend called AirScan as expained [https://nixos.wiki/wiki/Scanners here]. Otherwise commonly used driver packages include:
where <code>YOUR_DRIVER</code> is the driver package appropriate for your printer. Commonly used driver packages include:


* <tt>pkgs.gutenprint</tt> &mdash; Drivers for many different printers from many different vendors.
* <tt>pkgs.gutenprint</tt> &mdash; Drivers for many different printers from many different vendors.