aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common/optional/printer.nix
blob: e3109fcc87b03f56c15faf44b5bff648a1c4ad66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  hardware.printers = let
    brother = "Brother_HL-L2340D";
    ip = "192.168.1.20";
  in {
    ensureDefaultPrinter = brother;
    ensurePrinters = [{
      name = brother;
      deviceUri = "ipp://${ip}/ipp";
      model = "everywhere";
      description = lib.replaceStrings [ "_" ] [ " " ] brother;
      location = "home";
    }];
  };

  systemd.services."ensure-printers" = {
    after = [ "network-online.target" ];
    preStart = "sleep 5";
    wants = [ "network-online.target" ];
  };
}