summaryrefslogtreecommitdiff
path: root/sys/hardware/epson.nix
blob: 3900a2cda8b8378b67f46bfb481f4fbd871a912d (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
{ 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";
      }
    ];

    services.printing.enable = true;
    hardware.sane.enable = true;

    hardware.sane.extraBackends = [
      pkgs.epkowa
    ];

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