mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-22 22:09:34 +01:00
share printers
This commit is contained in:
parent
3b775c9387
commit
ece1c7d60b
@ -2,18 +2,54 @@
|
|||||||
{
|
{
|
||||||
# Printing with IPP everywhere capable printers
|
# Printing with IPP everywhere capable printers
|
||||||
# https://nixos.wiki/wiki/Printing
|
# https://nixos.wiki/wiki/Printing
|
||||||
|
# Share printer via AirPrint
|
||||||
|
# https://project-insanity.org/2021/10/12/share-printer-via-airprint-with-nixos/
|
||||||
|
# After following these steps, my manually added Lexmark E460dn was instantly found on an Apple iPad.
|
||||||
|
|
||||||
|
# When adding the Lexmark E460dn printer (via GNOME settings or directly on the CUPS web interface),
|
||||||
|
# it is not found lateron. Discovery through the detected URL does not work.
|
||||||
|
# Instead, I added it manually.
|
||||||
|
# - When adding a printer, select `AppSocket/HP JetDirect` as type.
|
||||||
|
# - Then fill in the IP of the printer, e.g. `socket://192.168.178.107:9100`
|
||||||
|
# Reference: https://infoserve.lexmark.com/ids/ifc/ids_topic.aspx?root=kb20220119195146366&gid=v54804876&id=v54804875&topic=HO2475&productCode=Lexmark_T642&loc=en_CA
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [ 631 ];
|
||||||
|
allowedUDPPorts = [ 631 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.printing = {
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
enable = true;
|
||||||
# HP and Lexmark drivers
|
# HP and Lexmark drivers
|
||||||
services.printing.drivers = [ pkgs.hplip pkgs.postscript-lexmark ];
|
drivers = [ pkgs.hplip pkgs.postscript-lexmark ];
|
||||||
services.avahi.enable = true;
|
# Specifies whether shared printers are advertised.
|
||||||
services.avahi.nssmdns = true;
|
browsing = true;
|
||||||
# WiFi printers
|
defaultShared = true;
|
||||||
services.avahi.openFirewall = true;
|
listenAddresses = [ "*:631" ];
|
||||||
|
allowFrom = [ "all" ];
|
||||||
|
extraConf = ''
|
||||||
|
DefaultPaperSize A4
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
# Whether to enable the mDNS NSS (Name Service Switch) plug-in.
|
||||||
|
# Enabling it allows applications to resolve names in the .local domain by transparently querying the Avahi daemon.
|
||||||
|
# -> Discover network printers.
|
||||||
|
nssmdns = true;
|
||||||
|
# Network printers
|
||||||
|
openFirewall = true;
|
||||||
|
publish = {
|
||||||
|
enable = true;
|
||||||
|
userServices = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Scanning
|
# Scanning
|
||||||
# https://nixos.wiki/wiki/Scanners
|
# https://nixos.wiki/wiki/Scanners
|
||||||
|
# HP OfficeJet scanning
|
||||||
# https://unix.stackexchange.com/questions/518687/how-do-i-set-up-scanning-from-an-hp-officejet-pro-on-nixos/518688
|
# https://unix.stackexchange.com/questions/518687/how-do-i-set-up-scanning-from-an-hp-officejet-pro-on-nixos/518688
|
||||||
hardware.sane = {
|
hardware.sane = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user