diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2022-11-04 14:05:43 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2022-11-04 14:05:43 +0100 |
commit | c3cff074f8dc3aaa4739ae0f60d0b3c907aba164 (patch) | |
tree | 0e013b07541e881eb426b056dc1c8eb22e0b1389 | |
parent | a704b9029586266f63807f64a6718f1a65b0f83b (diff) | |
download | nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar.gz nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar.bz2 nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar.lz nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar.xz nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.tar.zst nixpkgs-c3cff074f8dc3aaa4739ae0f60d0b3c907aba164.zip |
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.
-rw-r--r-- | nixos/modules/services/hardware/sane.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/sane.nix b/nixos/modules/services/hardware/sane.nix index 5455cf56e8a..ab36e204e1a 100644 --- a/nixos/modules/services/hardware/sane.nix +++ b/nixos/modules/services/hardware/sane.nix @@ -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 { |