at master 501 B view raw
1{ config, lib, ... }: 2 3let 4 cfg = config.custom; 5in 6{ 7 options.custom.printing = lib.mkEnableOption "printing"; 8 9 config = lib.mkIf cfg.printing { 10 networking.firewall = { 11 allowedTCPPorts = [ 631 ]; 12 allowedUDPPorts = [ 631 ]; 13 }; 14 services.printing = { 15 enable = true; 16 browsing = true; 17 defaultShared = true; 18 }; 19 services.avahi = { 20 enable = true; 21 publish.enable = true; 22 publish.userServices = true; 23 nssmdns4 = true; 24 }; 25 }; 26}