1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7{ 8 options = { 9 10 hardware.sane.dsseries.enable = lib.mkEnableOption "Brother DSSeries scan backend" // { 11 description = '' 12 When enabled, will automatically register the "dsseries" SANE backend. 13 14 This supports the Brother DSmobile scanner series, including the 15 DS-620, DS-720D, DS-820W, and DS-920DW scanners. 16 ''; 17 }; 18 }; 19 20 config = lib.mkIf (config.hardware.sane.enable && config.hardware.sane.dsseries.enable) { 21 22 hardware.sane.extraBackends = [ pkgs.dsseries ]; 23 services.udev.packages = [ pkgs.dsseries ]; 24 boot.kernelModules = [ "sg" ]; 25 26 }; 27}