From 9e275ffa58c1c1c88a995c0bf1c098b1f06f605f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 7 Jun 2010 21:09:27 +0000 Subject: [PATCH] Trying to improve the cups expression a bit, so it can print also with local usb printers. (Thank you Oleksandr) svn path=/nixos/trunk/; revision=22173 --- modules/services/printing/cupsd.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/services/printing/cupsd.nix b/modules/services/printing/cupsd.nix index 40760ec8af55..39ca4f68325b 100644 --- a/modules/services/printing/cupsd.nix +++ b/modules/services/printing/cupsd.nix @@ -106,6 +106,11 @@ in services.dbus.packages = [cups]; + # cups uses libusb to talk to printers, and does not use the + # linux kernel driver. If the driver is not in a black list, it + # gets loaded, and then cups cannot access the printers. + boot.blacklistedKernelModules = [ "usblp" ]; + environment.etc = [ # CUPS expects the following files in its ServerRoot. { source = "${cups}/etc/cups/mime.convs"; @@ -122,15 +127,17 @@ in startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; + environment = { + # Cups scripts for printing (psto...) require awk, sed, grep, ... + PATH = config.system.path; + }; + preStart = '' mkdir -m 0755 -p ${logDir} mkdir -m 0700 -p /var/cache/cups mkdir -m 0700 -p /var/spool/cups mkdir -m 0755 -p ${cfg.tempDir} - - # Make USB printers show up. - ${modprobe}/sbin/modprobe usblp || true ''; exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";