Merge pull request #199520 from bjornfor/nixos-hardware-sane-open-firewal

nixos/sane: add openFirewall option
This commit is contained in:
Ryan Lahfa 2022-12-01 14:50:11 +01:00 committed by GitHub
commit da5ef17a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,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;
@ -163,6 +172,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 {