summaryrefslogtreecommitdiff
path: root/sys/hardware/epson.nix
blob: 30b13034a15edb525deaa4480ebb9d1d2119540c (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; let
  cfg = config.local.hardware.epson;
in {
  options.local.hardware.epson = {
    enable = mkEnableOption "Epson printers and scanners";
  };

  config = mkIf cfg.enable {
    assertions = [
      {
        assertion = config.local.hardware.printing.enable;
        message = "epson requires printing";
      }
    ];

    hardware.sane = {
      enable = true;

      extraBackends = [
        pkgs.epkowa
      ];
    };

    services.printing = {
      enable = true;

      drivers = [
        pkgs.epson_201207w
      ];
    };
  };
}