nixos/sane: add openFirewall option

Open ports needed for discovery of scanners on the local network, e.g.
needed for Canon scanners (BJNP protocol).

Ref. https://github.com/NixOS/nixpkgs/issues/28406.
This commit is contained in:
Bjørn Forsman 2022-11-04 14:05:43 +01:00
parent a704b90295
commit c3cff074f8

View File

@ -124,6 +124,15 @@ in
'';
};
hardware.sane.openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Open ports needed for discovery of scanners on the local network, e.g.
needed for Canon scanners (BJNP protocol).
'';
};
services.saned.enable = mkOption {
type = types.bool;
default = false;
@ -159,6 +168,7 @@ in
services.udev.packages = backends;
users.groups.scanner.gid = config.ids.gids.scanner;
networking.firewall.allowedUDPPorts = mkIf config.hardware.sane.openFirewall [ 8612 ];
})
(mkIf config.services.saned.enable {