···
7
-
inherit (pkgs) cups cups-pk-helper cups-filters gutenprint;
7
+
inherit (pkgs) cups cups-pk-helper cups-filters;
cfg = config.services.printing;
···
[ cups.out additionalBackends cups-filters pkgs.ghostscript ]
38
-
++ optional cfg.gutenprint gutenprint
pathsToLink = [ "/lib" "/share/cups" "/bin" ];
postBuild = cfg.bindirCmds;
···
(writeConf "client.conf" cfg.clientConf)
(writeConf "snmp.conf" cfg.snmpConf)
] ++ optional avahiEnabled browsedFile
100
-
++ optional cfg.gutenprint gutenprint
pathsToLink = [ "/etc/cups" ];
104
+
filterGutenprint = pkgs: filter (pkg: pkg.meta.isGutenprint or false == true) pkgs;
105
+
containsGutenprint = pkgs: length (filterGutenprint pkgs) > 0;
106
+
getGutenprint = pkgs: head (filterGutenprint pkgs);
···
227
-
gutenprint = mkOption {
231
-
Whether to enable Gutenprint drivers for CUPS. This includes auto-updating
232
-
Gutenprint PPD files.
type = types.listOf types.path;
239
-
example = literalExample "[ pkgs.splix ]";
232
+
example = literalExample "[ pkgs.gutenprint pkgs.hplip pkgs.splix ]";
241
-
CUPS drivers to use. Drivers provided by CUPS, cups-filters, Ghostscript
242
-
and Samba are added unconditionally. For adding Gutenprint, see
243
-
<literal>gutenprint</literal>.
234
+
CUPS drivers to use. Drivers provided by CUPS, cups-filters,
235
+
Ghostscript and Samba are added unconditionally. If this list contains
236
+
Gutenprint (i.e. a derivation with
237
+
<literal>meta.isGutenprint = true</literal>) the PPD files in
238
+
<filename>/var/lib/cups/ppd</filename> will be updated automatically
239
+
to avoid errors due to incompatible versions.
···
[ ! -e /var/lib/cups/path ] && \
ln -s ${bindir} /var/lib/cups/path
321
-
${optionalString cfg.gutenprint ''
317
+
${optionalString (containsGutenprint cfg.drivers) ''
if [ -d /var/lib/cups/ppd ]; then
323
-
${gutenprint}/bin/cups-genppdupdate -p /var/lib/cups/ppd
319
+
${getGutenprint cfg.drivers}/bin/cups-genppdupdate -p /var/lib/cups/ppd