Printing: Difference between revisions
imported>Tobias.bora Enabling nssmdns is important if the shared printer have an address like "cups.local" |
imported>Tobias.bora Oups, I just realized that is was already documented... in the client version |
||
| Line 47: | Line 47: | ||
<ol> | <ol> | ||
<li> | <li>If you want to share a local printer on the network, ollow 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> | ||
<li>You should probably check that printing works locally at this point.</li> | <li>You should probably check that printing works locally at this point.</li> | ||
<li>Amend <tt>/etc/nixos/configuration.nix</tt>: | <li>Amend <tt>/etc/nixos/configuration.nix</tt>: | ||
| Line 56: | Line 56: | ||
# Enable automatic discovery of the printer from other Linux systems with avahi running. | # Enable automatic discovery of the printer from other Linux systems with avahi running. | ||
services.avahi.enable = true; | services.avahi.enable = true; | ||
services.avahi.publish.enable = true; | services.avahi.publish.enable = true; | ||
services.avahi.publish.userServices = true; | services.avahi.publish.userServices = true; | ||
| Line 77: | Line 76: | ||
=== Client (Linux) === | === Client (Linux) === | ||
If you enabled {{nixos:option|services.avahi.publish.userServices}} in the server configuration, enabling printing and avahi on the client should be sufficient for the printer to be detected: | If you want to use a printer shared on the network, and if you enabled {{nixos:option|services.avahi.publish.userServices}} in the server configuration, enabling printing and avahi on the client should be sufficient for the printer to be detected: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ | { | ||
| Line 83: | Line 82: | ||
services.printing.enable = true; | services.printing.enable = true; | ||
services.avahi.enable = true; | services.avahi.enable = true; | ||
# Important to resolve .local domains of printers, otherwise you get an error | |||
# like "Impossible to connect to XXX.local: Name or service not known" | |||
services.avahi.nssmdns = true; | services.avahi.nssmdns = true; | ||
} | } | ||