{ config, lib, pkgs, ... }: with lib; let cfg = config.services.malobeo.printing; driverFile = pkgs.writeTextDir "share/cups/model/konicaminoltac258.ppd" (builtins.readFile ../KOC658UX.ppd); defaultPpdOptions = { PageSize = "A4"; SelectColor = "Grayscale"; Finisher = "FS534"; SaddleUnit = "SD511"; Model = "C258"; InputSlot = "Tray1"; }; in { options.services.malobeo.printing = { enable = mkOption { type = types.bool; default = false; description = "Setup malobeo printers"; }; }; config = mkIf (cfg.enable) { services.printing.enable = true; services.printing.drivers = [ driverFile ]; hardware.printers.ensurePrinters = [ { name = "KonicaDefault"; model = "konicaminoltac258.ppd"; location = "Zine Workshop"; deviceUri = "ipp://192.168.1.42/ipp"; ppdOptions = defaultPpdOptions; } { name = "KonicaBooklet"; model = "konicaminoltac258.ppd"; location = "Zine Workshop"; deviceUri = "ipp://192.168.1.42/ipp"; ppdOptions = defaultPpdOptions // { Fold = "Stitch"; Staple = "None"; }; } ]; }; }