diff --git a/modules/networking/brother_home.ppd b/modules/networking/brother_home.ppd new file mode 100644 index 0000000..d61ef59 --- /dev/null +++ b/modules/networking/brother_home.ppd @@ -0,0 +1,195 @@ +*PPD-Adobe: "4.3" +*cupsMandatory: attributes-charset attributes-natural-language printer-uri +*FormatVersion: "4.3" +*FileVersion: "2.4" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PSVersion: "(3010.000) 0" +*LanguageLevel: "3" +*FileSystem: False +*PCFileName: "ippeve.ppd" +*Manufacturer: "Brother" +*ModelName: "Printer" +*Product: "(Printer)" +*NickName: "Printer - IPP Everywhere" +*ShortNickName: "Printer - IPP Everywhere" +*ColorDevice: False +*cupsVersion: 2.4 +*cupsSNMPSupplies: False +*cupsLanguages: "en_US" +*APSupplies: "http://brnb42200bfd3f4.local./net/net/airprint.html" +*cupsManualCopies: True +*cupsFilter2: "image/urf image/urf 100 -" +*cupsUrfSupported: "W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ3-4-5,RS300-600-1200,V1.4,DM1" +*OpenUI *PageSize: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize 215x345mm: "<>setpagedevice" +*PageSize 3x5: "<>setpagedevice" +*PageSize A4: "<>setpagedevice" +*PageSize A5: "<>setpagedevice" +*PageSize A6: "<>setpagedevice" +*PageSize Env10: "<>setpagedevice" +*PageSize EnvC5: "<>setpagedevice" +*PageSize EnvDL: "<>setpagedevice" +*PageSize EnvMonarch: "<>setpagedevice" +*PageSize Executive: "<>setpagedevice" +*PageSize FanFoldGermanLegal: "<>setpagedevice" +*PageSize ISOB5: "<>setpagedevice" +*PageSize Legal: "<>setpagedevice" +*PageSize Letter: "<>setpagedevice" +*PageSize Oficio: "<>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion 215x345mm: "<>setpagedevice" +*PageRegion 3x5: "<>setpagedevice" +*PageRegion A4: "<>setpagedevice" +*PageRegion A5: "<>setpagedevice" +*PageRegion A6: "<>setpagedevice" +*PageRegion Env10: "<>setpagedevice" +*PageRegion EnvC5: "<>setpagedevice" +*PageRegion EnvDL: "<>setpagedevice" +*PageRegion EnvMonarch: "<>setpagedevice" +*PageRegion Executive: "<>setpagedevice" +*PageRegion FanFoldGermanLegal: "<>setpagedevice" +*PageRegion ISOB5: "<>setpagedevice" +*PageRegion Legal: "<>setpagedevice" +*PageRegion Letter: "<>setpagedevice" +*PageRegion Oficio: "<>setpagedevice" +*CloseUI: *PageRegion +*DefaultImageableArea: A4 +*DefaultPaperDimension: A4 +*ImageableArea 215x345mm: "12.245669291339 12.245669291339 597.203149606299 965.707086614173" +*PaperDimension 215x345mm: "609.448818897638 977.952755905512" +*ImageableArea 3x5: "12.245669291339 12.245669291339 203.754330708661 347.754330708661" +*PaperDimension 3x5: "216 360" +*ImageableArea A4: "12.245669291339 12.245669291339 583.029921259842 829.644094488189" +*PaperDimension A4: "595.275590551181 841.889763779528" +*ImageableArea A5: "12.245669291339 12.245669291339 407.28188976378 583.029921259842" +*PaperDimension A5: "419.527559055118 595.275590551181" +*ImageableArea A6: "12.245669291339 12.245669291339 285.392125984252 407.28188976378" +*PaperDimension A6: "297.637795275591 419.527559055118" +*ImageableArea Env10: "12.245669291339 12.245669291339 284.740157480315 671.754330708661" +*PaperDimension Env10: "296.985826771654 684" +*ImageableArea EnvC5: "12.245669291339 12.245669291339 446.966929133858 636.888188976378" +*PaperDimension EnvC5: "459.212598425197 649.133858267717" +*ImageableArea EnvDL: "12.245669291339 12.245669291339 299.565354330709 611.376377952756" +*PaperDimension EnvDL: "311.811023622047 623.622047244094" +*ImageableArea EnvMonarch: "12.245669291339 12.245669291339 266.740157480315 527.754330708661" +*PaperDimension EnvMonarch: "278.985826771654 540" +*ImageableArea Executive: "12.245669291339 12.245669291339 509.754330708661 743.754330708661" +*PaperDimension Executive: "522 756" +*ImageableArea FanFoldGermanLegal: "12.245669291339 12.245669291339 599.754330708661 923.754330708661" +*PaperDimension FanFoldGermanLegal: "612 936" +*ImageableArea ISOB5: "12.245669291339 12.245669291339 486.651968503937 696.415748031496" +*PaperDimension ISOB5: "498.897637795276 708.661417322835" +*ImageableArea Legal: "12.245669291339 12.245669291339 599.754330708661 995.754330708661" +*PaperDimension Legal: "612 1008" +*ImageableArea Letter: "12.245669291339 12.245669291339 599.754330708661 779.754330708661" +*PaperDimension Letter: "612 792" +*ImageableArea Oficio: "12.245669291339 12.245669291339 599.754330708661 952.554330708661" +*PaperDimension Oficio: "612 964.8" +*HWMargins: "12.245669291339 12.245669291339 12.245669291339 12.245669291339" +*ParamCustomPageSize Width: 1 points 216 612 +*ParamCustomPageSize Height: 2 points 360 1008 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 3 +*CustomPageSize True: "pop pop pop <>setpagedevice" +*OpenUI *InputSlot: PickOne +*OrderDependency: 10 AnySetup *InputSlot +*DefaultInputSlot: Auto +*InputSlot Auto: "<>setpagedevice" +*en_US.InputSlot Auto/Automatic: "" +*InputSlot Manual: "<>setpagedevice" +*en_US.InputSlot Manual/Manual: "" +*InputSlot Tray1: "<>setpagedevice" +*en_US.InputSlot Tray1/Tray 1: "" +*CloseUI: *InputSlot +*OpenUI *MediaType: PickOne +*OrderDependency: 10 AnySetup *MediaType +*DefaultMediaType: Stationery +*MediaType Stationery: "<>setpagedevice" +*en_US.MediaType Stationery/Stationery: "" +*MediaType StationeryLightweight: "<>setpagedevice" +*en_US.MediaType StationeryLightweight/Lightweight Paper: "" +*MediaType StationeryHeavyweight: "<>setpagedevice" +*en_US.MediaType StationeryHeavyweight/Heavyweight Paper: "" +*MediaType StationeryCover: "<>setpagedevice" +*MediaType Envelope: "<>setpagedevice" +*en_US.MediaType Envelope/Envelope: "" +*MediaType EnvelopeHeavyweight: "<>setpagedevice" +*en_US.MediaType EnvelopeHeavyweight/Heavyweight Envelope: "" +*MediaType EnvelopeLightweight: "<>setpagedevice" +*en_US.MediaType EnvelopeLightweight/Lightweight Envelope: "" +*MediaType StationeryRecycled: "<>setpagedevice" +*MediaType Labels: "<>setpagedevice" +*en_US.MediaType Labels/Labels: "" +*MediaType StationeryBond: "<>setpagedevice" +*MediaType Com.brother.thicker: "<>setpagedevice" +*MediaType Com.brother.recycled: "<>setpagedevice" +*CloseUI: *MediaType +*DefaultResolution: 300dpi +*OpenUI *cupsPrintQuality: PickOne +*OrderDependency: 10 AnySetup *cupsPrintQuality +*en_US.Translation cupsPrintQuality/Print Quality: "" +*DefaultcupsPrintQuality: High +*cupsPrintQuality Draft: "<>setpagedevice" +*en_US.cupsPrintQuality Draft/Draft: "" +*cupsPrintQuality Normal: "<>setpagedevice" +*en_US.cupsPrintQuality Normal/Normal: "" +*cupsPrintQuality High: "<>setpagedevice" +*en_US.cupsPrintQuality High/High: "" +*CloseUI: *cupsPrintQuality +*% ColorModel from urf-supported +*OpenUI *ColorModel: PickOne +*OrderDependency: 10 AnySetup *ColorModel +*en_US.Translation ColorModel/Color Mode: "" +*ColorModel Gray: "<>setpagedevice" +*en_US.ColorModel Gray/Grayscale: "" +*DefaultColorModel: Gray +*CloseUI: *ColorModel +*APPrinterPreset Gray_with_Paper_Auto-Detect_-_Draft/Draft B&W: " + *cupsPrintQuality Draft *ColorModel Gray + com.apple.print.preset.graphicsType General + com.apple.print.preset.quality low + com.apple.print.preset.media-front-coating autodetect + com.apple.print.preset.output-mode monochrome" +*End +*APPrinterPreset Gray_with_Paper_Auto-Detect/Black and White: " + *cupsPrintQuality Normal *ColorModel Gray + com.apple.print.preset.graphicsType General + com.apple.print.preset.quality mid + com.apple.print.preset.media-front-coating autodetect + com.apple.print.preset.output-mode monochrome" +*End +*APPrinterPreset Photo_with_Paper_Auto-Detect/Photo: " + *cupsPrintQuality High *ColorModel Gray + com.apple.print.preset.graphicsType Photo + com.apple.print.preset.quality high + com.apple.print.preset.media-front-coating autodetect + com.apple.print.preset.output-mode color" +*End +*OpenUI *Duplex: PickOne +*OrderDependency: 10 AnySetup *Duplex +*en_US.Translation Duplex/2-Sided Printing: "" +*DefaultDuplex: None +*Duplex None: "<>setpagedevice" +*en_US.Duplex None/Off (1-Sided): "" +*Duplex DuplexNoTumble: "<>setpagedevice" +*en_US.Duplex DuplexNoTumble/Long-Edge (Portrait): "" +*Duplex DuplexTumble: "<>setpagedevice" +*en_US.Duplex DuplexTumble/Short-Edge (Landscape): "" +*CloseUI: *Duplex +*cupsBackSide: Normal +*OpenUI *OutputBin: PickOne +*OrderDependency: 10 AnySetup *OutputBin +*DefaultOutputBin: FaceDown +*DefaultOutputOrder: Normal +*OutputBin FaceDown: "" +*en_US.OutputBin FaceDown/Face Down: "" +*PageStackOrder FaceDown: Normal +*CloseUI: *OutputBin +*cupsSingleFile: true diff --git a/modules/networking/printing.nix b/modules/networking/printing.nix index c5be121..08cf75e 100644 --- a/modules/networking/printing.nix +++ b/modules/networking/printing.nix @@ -1,21 +1,36 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.custom.networking.printing; in { - options.custom.networking.printing.enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; + options.custom.networking.printing.enable = lib.mkEnableOption "printing at home"; config = lib.mkIf cfg.enable { - services = { - printing.enable = true; - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; + services.printing = { + enable = true; + + drivers = lib.singleton ( + pkgs.linkFarm "drivers" [ + { + name = "share/cups/model/brother_home.ppd"; + path = ./brother_home.ppd; + } + ] + ); }; + + hardware.printers.ensurePrinters = [ + { + name = "Borther_HL-L2370DN"; + location = "Home"; + deviceUri = "ipps://printer.vsinerva.fi:631/ipp/print"; + model = "brother_home.ppd"; + } + ]; }; }