Printing: Difference between revisions
imported>Onny Further cleanup |
imported>Onny Further cleanup |
||
Line 60: | Line 60: | ||
Discovery is done via the opened UDP port <code>5353</code>. Printers should get automatically detected and visible in your printer configuration client. | Discovery is done via the opened UDP port <code>5353</code>. Printers should get automatically detected and visible in your printer configuration client. | ||
=== Printer sharing === | |||
If you want to share a local printer on the network, follow the steps in [[#basic-configuration|Basic Configuration]], but check “Share This Printer” when adding it to CUPS. If you have already added the printer to CUPS, reconfigure it to make it a shared printer.</li> | |||
<syntaxhighlight lang="nix"> | |||
services.avahi = { | |||
enable = true; | |||
publish = { | |||
enable = true; | |||
userServices = true; | |||
}; | |||
}; | |||
services.printing = { | |||
browsing = true; | |||
listenAddresses = [ "*:631" ]; | |||
allowFrom = [ "all" ]; # this gives access to anyone on the interface you might want to limit it see the official documentation | |||
defaultShared = true; # If you want | |||
}; | |||
networking.firewall = { | |||
allowedTCPPorts = [ 631 ]; | |||
allowedUDPPorts = [ 631 ]; | |||
}; | |||
</syntaxhighlight> | |||
Once printer sharing is enabled, it could be additionally advertised in the home network via the Samba protocol, [[Samba#Printer_sharing|see]]. | |||
==== With a raw PPD ==== | ==== With a raw PPD ==== | ||
Line 120: | Line 146: | ||
For debugging purpose, it may be interesting to note that the data folder used by cups (containing the drivers and more) can be obtained by looking in the environment <code>$CUPS_DATADIR</code> (the contents of <code>$out/share/cups/</code> contained in your drivers are linked in this folder). | For debugging purpose, it may be interesting to note that the data folder used by cups (containing the drivers and more) can be obtained by looking in the environment <code>$CUPS_DATADIR</code> (the contents of <code>$out/share/cups/</code> contained in your drivers are linked in this folder). | ||
== Troubleshooting == | |||
==Troubleshooting== | |||
=== Adding network printer "Name or service not known" === | === Adding network printer "Name or service not known" === | ||
Line 260: | Line 242: | ||
Now watch the cups logs for errors like <code>No such file or directory</code> | Now watch the cups logs for errors like <code>No such file or directory</code> | ||
[[Category:Printing]] | |||
[[Category:Hardware]] |