nixos/desktop/2dprinting.nix
Julian Sutter 3c527c8109 2dprinting
2024-12-26 23:27:37 -08:00

30 lines
761 B
Nix
Executable file

{ config, pkgs, lib, ... }:
{
# Enable printing services with dynamic detection
services.printing = {
enable = true;
drivers = [
pkgs.hplipWithPlugin # HP printer driver with proprietary plugin support
pkgs.brlaser # Brother printer drivers
];
# Set default paper size via CUPS configuration
extraConf = ''
DefaultPaperSize Letter
'';
};
# Enable Avahi for printer discovery (IPv4 only)
services.avahi = {
enable = true;
publish.enable = true;
publish.addresses = true;
nssmdns4 = true; # Enable mDNS for IPv4
nssmdns6 = false; # Disable mDNS for IPv6 to prevent timeouts
};
networking.firewall.allowedTCPPorts = [ 631 ];
networking.firewall.allowedUDPPorts = [ 5353 ];
}