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