Enable declarative printer config

This commit is contained in:
Vili Sinervä 2025-07-24 11:48:48 +03:00
parent 666846c717
commit bebe8827fc
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
2 changed files with 222 additions and 12 deletions

View file

@ -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: "<</PageSize[609.448818897638 977.952755905512]>>setpagedevice"
*PageSize 3x5: "<</PageSize[216 360]>>setpagedevice"
*PageSize A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice"
*PageSize A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice"
*PageSize A6: "<</PageSize[297.637795275591 419.527559055118]>>setpagedevice"
*PageSize Env10: "<</PageSize[296.985826771654 684]>>setpagedevice"
*PageSize EnvC5: "<</PageSize[459.212598425197 649.133858267717]>>setpagedevice"
*PageSize EnvDL: "<</PageSize[311.811023622047 623.622047244094]>>setpagedevice"
*PageSize EnvMonarch: "<</PageSize[278.985826771654 540]>>setpagedevice"
*PageSize Executive: "<</PageSize[522 756]>>setpagedevice"
*PageSize FanFoldGermanLegal: "<</PageSize[612 936]>>setpagedevice"
*PageSize ISOB5: "<</PageSize[498.897637795276 708.661417322835]>>setpagedevice"
*PageSize Legal: "<</PageSize[612 1008]>>setpagedevice"
*PageSize Letter: "<</PageSize[612 792]>>setpagedevice"
*PageSize Oficio: "<</PageSize[612 964.8]>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion: PickOne
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: A4
*PageRegion 215x345mm: "<</PageSize[609.448818897638 977.952755905512]>>setpagedevice"
*PageRegion 3x5: "<</PageSize[216 360]>>setpagedevice"
*PageRegion A4: "<</PageSize[595.275590551181 841.889763779528]>>setpagedevice"
*PageRegion A5: "<</PageSize[419.527559055118 595.275590551181]>>setpagedevice"
*PageRegion A6: "<</PageSize[297.637795275591 419.527559055118]>>setpagedevice"
*PageRegion Env10: "<</PageSize[296.985826771654 684]>>setpagedevice"
*PageRegion EnvC5: "<</PageSize[459.212598425197 649.133858267717]>>setpagedevice"
*PageRegion EnvDL: "<</PageSize[311.811023622047 623.622047244094]>>setpagedevice"
*PageRegion EnvMonarch: "<</PageSize[278.985826771654 540]>>setpagedevice"
*PageRegion Executive: "<</PageSize[522 756]>>setpagedevice"
*PageRegion FanFoldGermanLegal: "<</PageSize[612 936]>>setpagedevice"
*PageRegion ISOB5: "<</PageSize[498.897637795276 708.661417322835]>>setpagedevice"
*PageRegion Legal: "<</PageSize[612 1008]>>setpagedevice"
*PageRegion Letter: "<</PageSize[612 792]>>setpagedevice"
*PageRegion Oficio: "<</PageSize[612 964.8]>>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 <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice"
*OpenUI *InputSlot: PickOne
*OrderDependency: 10 AnySetup *InputSlot
*DefaultInputSlot: Auto
*InputSlot Auto: "<</MediaPosition 0>>setpagedevice"
*en_US.InputSlot Auto/Automatic: ""
*InputSlot Manual: "<</MediaPosition 4>>setpagedevice"
*en_US.InputSlot Manual/Manual: ""
*InputSlot Tray1: "<</MediaPosition 20>>setpagedevice"
*en_US.InputSlot Tray1/Tray 1: ""
*CloseUI: *InputSlot
*OpenUI *MediaType: PickOne
*OrderDependency: 10 AnySetup *MediaType
*DefaultMediaType: Stationery
*MediaType Stationery: "<</MediaType(Stationery)>>setpagedevice"
*en_US.MediaType Stationery/Stationery: ""
*MediaType StationeryLightweight: "<</MediaType(StationeryLightweight)>>setpagedevice"
*en_US.MediaType StationeryLightweight/Lightweight Paper: ""
*MediaType StationeryHeavyweight: "<</MediaType(StationeryHeavyweight)>>setpagedevice"
*en_US.MediaType StationeryHeavyweight/Heavyweight Paper: ""
*MediaType StationeryCover: "<</MediaType(StationeryCover)>>setpagedevice"
*MediaType Envelope: "<</MediaType(Envelope)>>setpagedevice"
*en_US.MediaType Envelope/Envelope: ""
*MediaType EnvelopeHeavyweight: "<</MediaType(EnvelopeHeavyweight)>>setpagedevice"
*en_US.MediaType EnvelopeHeavyweight/Heavyweight Envelope: ""
*MediaType EnvelopeLightweight: "<</MediaType(EnvelopeLightweight)>>setpagedevice"
*en_US.MediaType EnvelopeLightweight/Lightweight Envelope: ""
*MediaType StationeryRecycled: "<</MediaType(StationeryRecycled)>>setpagedevice"
*MediaType Labels: "<</MediaType(Labels)>>setpagedevice"
*en_US.MediaType Labels/Labels: ""
*MediaType StationeryBond: "<</MediaType(StationeryBond)>>setpagedevice"
*MediaType Com.brother.thicker: "<</MediaType(Com.brother.thicker)>>setpagedevice"
*MediaType Com.brother.recycled: "<</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: "<</HWResolution[300 150]>>setpagedevice"
*en_US.cupsPrintQuality Draft/Draft: ""
*cupsPrintQuality Normal: "<</HWResolution[300 300]>>setpagedevice"
*en_US.cupsPrintQuality Normal/Normal: ""
*cupsPrintQuality High: "<</HWResolution[1200 1200]>>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: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>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: "<</Duplex false>>setpagedevice"
*en_US.Duplex None/Off (1-Sided): ""
*Duplex DuplexNoTumble: "<</Duplex true/Tumble false>>setpagedevice"
*en_US.Duplex DuplexNoTumble/Long-Edge (Portrait): ""
*Duplex DuplexTumble: "<</Duplex true/Tumble true>>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

View file

@ -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";
}
];
};
}