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: | ||
== | ==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. | where <code>YOUR_DRIVER</code> is the driver package appropriate for your printer. Commonly used driver packages include: | ||
* <tt>pkgs.gutenprint</tt> — Drivers for many different printers from many different vendors. | * <tt>pkgs.gutenprint</tt> — Drivers for many different printers from many different vendors. | ||