1 { pkgs, lib, config, ... }:
4 ../../nixos/profiles/printing.nix
5 ../../nixos/profiles/hardware/HP_Deskjet_1510.nix
8 listenAddresses = ["*:631"];
15 DefaultEncryption IfRequested
19 # DebugNote: SANE_DEBUG_NET=128 SANE_NET_HOSTS=aubergine.local scanimage -L
23 data_portrange = 40000 - 40100
27 systemd.services."saned@" = {
28 #environment.SANE_DEBUG_HPAIO = "128";
29 #environment.SANE_DEBUG_NET = "128";
31 networking.nftables.ruleset =
32 lib.optionalString config.services.printing.openFirewall ''
35 tcp dport ipp counter accept comment "cupsd: IPP"
38 '' + lib.optionalString config.services.saned.enable ''
40 ct helper conntrack-sane {
41 type "sane" protocol tcp;
44 # This will track saned's data port for `ct related`
45 tcp dport sane-port counter ct helper set "conntrack-sane"
48 tcp dport sane-port counter accept comment "saned: control port"
49 # NoticeNote: not actually useful because there is a rule `ct related accept` before
50 ct helper "sane" counter accept comment "saned: data ports"