about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/hardware/sane_extra_backends/dsseries.nix
blob: 5b05694abc017ad86ee5673a36f9f19451f36e45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, pkgs, ... }:

with lib;

{
  options = {

    hardware.sane.dsseries.enable =
      mkEnableOption (lib.mdDoc "Brother DSSeries scan backend") // {
      description = lib.mdDoc ''
        When enabled, will automatically register the "dsseries" SANE backend.

        This supports the Brother DSmobile scanner series, including the
        DS-620, DS-720D, DS-820W, and DS-920DW scanners.
      '';
    };
  };

  config = mkIf (config.hardware.sane.enable && config.hardware.sane.dsseries.enable) {

    hardware.sane.extraBackends = [ pkgs.dsseries ];
    services.udev.packages = [ pkgs.dsseries ];
    boot.kernelModules = [ "sg" ];

  };
}