Skip to content

Commit c649404

Browse files
committed
switch to client-side cups-browsed cluster
Replace server-side CUPS classes with individual shared printers and client-side cups-browsed clustering. This fixes copies-supported not being advertised by CUPS 2.4.x classes, and gives clients full PPD access (duplex, color) in the print dialog. Server changes: - consolidate printers and PPDs Client changes: - Add local cupsd + cups-browsed on desktops (profiles/desktop.nix) polling printhost-dev with an explicit OCF cluster - set default printer to new OCF cluster - update firefox preferences for new printer name TODO: - remove firefox css override so color dialog is visible again ...
1 parent 208b6ee commit c649404

12 files changed

Lines changed: 49 additions & 2769 deletions

File tree

modules/graphical/apps/browsers.nix

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -94,79 +94,20 @@ in
9494
};
9595

9696
Preferences = {
97-
"print.printer_color-double.print_paper_height" = {
97+
"print.printer_OCF.print_paper_height" = {
9898
Value = "279.4";
9999
Status = "default";
100100
};
101-
"print.printer_color-double.print_paper_id" = {
101+
"print.printer_OCF.print_paper_id" = {
102102
Value = "na_letter";
103103
Status = "default";
104104
};
105-
"print.printer_color-double.print_paper_size_unit" = {
105+
"print.printer_OCF.print_paper_size_unit" = {
106106
Value = 1;
107107
Status = "default";
108108
Type = "number";
109109
};
110-
"print.printer_color-double.print_paper_width" = {
111-
Value = "215.9";
112-
Status = "default";
113-
};
114-
"print.printer_color-single.print_paper_height" = {
115-
Value = "279.4";
116-
Status = "default";
117-
};
118-
"print.printer_color-single.print_paper_id" = {
119-
Value = "na_letter";
120-
Status = "default";
121-
};
122-
"print.printer_color-single.print_paper_size_unit" = {
123-
Value = 1;
124-
Status = "default";
125-
Type = "number";
126-
};
127-
"print.printer_color-single.print_paper_width" = {
128-
Value = "215.9";
129-
Status = "default";
130-
};
131-
"print.printer_double.print_in_color" = {
132-
Value = false;
133-
Status = "default";
134-
};
135-
"print.printer_double.print_paper_height" = {
136-
Value = "279.4";
137-
Status = "default";
138-
};
139-
"print.printer_double.print_paper_id" = {
140-
Value = "na_letter";
141-
Status = "default";
142-
};
143-
"print.printer_double.print_paper_size_unit" = {
144-
Value = 1;
145-
Status = "default";
146-
Type = "number";
147-
};
148-
"print.printer_double.print_paper_width" = {
149-
Value = "215.9";
150-
Status = "default";
151-
};
152-
"print.printer_single.print_in_color" = {
153-
Value = false;
154-
Status = "default";
155-
};
156-
"print.printer_single.print_paper_height" = {
157-
Value = "279.4";
158-
Status = "default";
159-
};
160-
"print.printer_single.print_paper_id" = {
161-
Value = "na_letter";
162-
Status = "default";
163-
};
164-
"print.printer_single.print_paper_size_unit" = {
165-
Value = 1;
166-
Status = "default";
167-
Type = "number";
168-
};
169-
"print.printer_single.print_paper_width" = {
110+
"print.printer_OCF.print_paper_width" = {
170111
Value = "215.9";
171112
Status = "default";
172113
};

modules/printhost/cups.nix

Lines changed: 22 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,8 @@ let
9191
install -Dm0700 ${ocfBackendBin} $out/lib/cups/backend/ocfbackend
9292
'';
9393

94-
# PPD files package — all printers reference these at setup time
95-
ppdDir = pkgs.runCommand "printhost-ppds" { } ''
96-
install -Dm0644 ${./ppd/logjam-single.ppd} $out/share/ppd/logjam-single.ppd
97-
install -Dm0644 ${./ppd/logjam-double.ppd} $out/share/ppd/logjam-double.ppd
98-
install -Dm0644 ${./ppd/pagefault-single.ppd} $out/share/ppd/pagefault-single.ppd
99-
install -Dm0644 ${./ppd/pagefault-double.ppd} $out/share/ppd/pagefault-double.ppd
100-
install -Dm0644 ${./ppd/papercut-single.ppd} $out/share/ppd/papercut-single.ppd
101-
install -Dm0644 ${./ppd/papercut-double.ppd} $out/share/ppd/papercut-double.ppd
102-
install -Dm0644 ${./ppd/epson-single.ppd} $out/share/ppd/epson-single.ppd
103-
install -Dm0644 ${./ppd/epson-double.ppd} $out/share/ppd/epson-double.ppd
104-
'';
94+
hpPpd = ./ppd/hp-m806.ppd;
95+
epsonPpd = ./ppd/epson-et5880.ppd;
10596

10697
in
10798
{
@@ -168,83 +159,33 @@ in
168159
sleep 2
169160
done
170161
171-
# ── HP LaserJet printers (socket/9100 raw TCP) ──────────────────────
172-
lpadmin -p logjam-single \
173-
-v ocfbackend:socket://169.229.226.92:9100 \
174-
-P ${ppdDir}/share/ppd/logjam-single.ppd \
175-
-D "HP LaserJet M806 single-sided" -L "OCF lab" \
176-
-E -o printer-is-shared=false
177-
178-
lpadmin -p logjam-double \
162+
# ── HP LaserJet M806 printers (socket/9100 raw TCP) ──────────────────
163+
# Each printer is shared individually; clients use cups-browsed to
164+
# cluster them into a single "OCF" queue with load balancing.
165+
lpadmin -p logjam \
179166
-v ocfbackend:socket://169.229.226.92:9100 \
180-
-P ${ppdDir}/share/ppd/logjam-double.ppd \
181-
-D "HP LaserJet M806 double-sided" -L "OCF lab" \
182-
-E -o printer-is-shared=false
183-
184-
lpadmin -p pagefault-single \
185-
-v ocfbackend:socket://169.229.226.91:9100 \
186-
-P ${ppdDir}/share/ppd/pagefault-single.ppd \
187-
-D "HP LaserJet M806 single-sided" -L "OCF lab" \
188-
-E -o printer-is-shared=false
167+
-P ${hpPpd} \
168+
-D "HP LaserJet M806" -L "OCF lab" \
169+
-E -o printer-is-shared=true
189170
190-
lpadmin -p pagefault-double \
171+
lpadmin -p pagefault \
191172
-v ocfbackend:socket://169.229.226.91:9100 \
192-
-P ${ppdDir}/share/ppd/pagefault-double.ppd \
193-
-D "HP LaserJet M806 double-sided" -L "OCF lab" \
194-
-E -o printer-is-shared=false
173+
-P ${hpPpd} \
174+
-D "HP LaserJet M806" -L "OCF lab" \
175+
-E -o printer-is-shared=true
195176
196-
lpadmin -p papercut-single \
177+
lpadmin -p papercut \
197178
-v ocfbackend:socket://169.229.226.93:9100 \
198-
-P ${ppdDir}/share/ppd/papercut-single.ppd \
199-
-D "HP LaserJet M806 single-sided" -L "OCF lab" \
200-
-E -o printer-is-shared=false
201-
202-
lpadmin -p papercut-double \
203-
-v ocfbackend:socket://169.229.226.93:9100 \
204-
-P ${ppdDir}/share/ppd/papercut-double.ppd \
205-
-D "HP LaserJet M806 double-sided" -L "OCF lab" \
206-
-E -o printer-is-shared=false
207-
208-
# ── Epson ET-5880 (IPP/S) ────────────────────────────────────────────
209-
lpadmin -p epson-single \
210-
-v ocfbackend:ipps://169.229.226.96/ipp/print \
211-
-P ${ppdDir}/share/ppd/epson-single.ppd \
212-
-D "Epson ET-5880 single-sided color" -L "OCF lab" \
213-
-E -o printer-is-shared=false
179+
-P ${hpPpd} \
180+
-D "HP LaserJet M806" -L "OCF lab" \
181+
-E -o printer-is-shared=true
214182
215-
lpadmin -p epson-double \
183+
# ── Epson ET-5880 color printer (IPP/S) ──────────────────────────────
184+
lpadmin -p epson \
216185
-v ocfbackend:ipps://169.229.226.96/ipp/print \
217-
-P ${ppdDir}/share/ppd/epson-double.ppd \
218-
-D "Epson ET-5880 double-sided color" -L "OCF lab" \
219-
-E -o printer-is-shared=false
220-
221-
# ── Classes ──────────────────────────────────────────────────────────
222-
for p in logjam-double pagefault-double papercut-double; do
223-
lpadmin -p "$p" -c double
224-
done
225-
lpadmin -p double -D "Double-sided printing" -L "OCF lab" \
226-
-P ${ppdDir}/share/ppd/logjam-double.ppd
227-
228-
for p in logjam-single pagefault-single papercut-single; do
229-
lpadmin -p "$p" -c single
230-
done
231-
lpadmin -p single -D "Single-sided printing" -L "OCF lab" \
232-
-P ${ppdDir}/share/ppd/logjam-single.ppd
233-
234-
lpadmin -p epson-single -c color-single
235-
lpadmin -p color-single -D "Single-sided color printing" -L "OCF lab" \
236-
-P ${ppdDir}/share/ppd/epson-single.ppd
237-
238-
lpadmin -p epson-double -c color-double
239-
lpadmin -p color-double -D "Double-sided color printing" -L "OCF lab" \
240-
-P ${ppdDir}/share/ppd/epson-double.ppd
241-
242-
# Enable and accept jobs for all classes (shared with clients)
243-
for cls in single double color-single color-double; do
244-
cupsenable "$cls"
245-
cupsaccept "$cls"
246-
lpadmin -p "$cls" -o printer-is-shared=true
247-
done
186+
-P ${epsonPpd} \
187+
-D "Epson ET-5880 Color" -L "OCF lab" \
188+
-E -o printer-is-shared=true
248189
'';
249190
};
250191

0 commit comments

Comments
 (0)