summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/printer.nix
blob: 72b9dadd6fd4bc0ee97a83b6070e744a2b8c8ca5 (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
39
40
41
42
43
44
45
46
{ config, pkgs, ... }:

let
  mainUser = config.krebs.build.user.name;
in {
  services.printing = {
    enable = true;
    drivers = with pkgs; [
      # samsungUnifiedLinuxDriver
      splix # scx 3200
      cups-dymo # dymo labelwriter
      foo2zjs # magicolor 1690mf
      cups-zj-58
    ];
  };

  users.users."${mainUser}".extraGroups = [ "scanner" "lp" ];

  # scanners are printers just in reverse anyway
  services.saned.enable = true;
  hardware.sane = {
    enable = true;
    extraBackends = [ ];
    extraConfig.xerox_mfp = ''
      usb 0x04e8 0x3441
    '';
    #netConf =
    #  # drucker.lan SCX-3205W
    #  ''
    #    192.168.111.16''
    #  # uhrenkind.shack magicolor 1690mf
    #+ ''
    #    10.42.20.30'';

    ## $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150

    ## requires 'sane-extra', scan via:
    #extraConfig."magicolor" = ''
    #  net 10.42.20.30 0x2098
    #''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf
  };
  state = [ "/var/lib/cups" ];
  services.udev.extraRules = ''
    ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3441", ENV{libsane_matched}="yes"
  '';
}