From 93c19c4ae9d93faea2446b7bd4225c8481f2ed44 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 17 Jan 2009 13:10:06 +0000 Subject: [PATCH] * CUPS daemon: modprobe usblp so that CUPS can find USB printers. * CUPS daemon: use Ghostscript to support printing on non-Postscript printers. svn path=/nixos/trunk/; revision=13794 --- upstart-jobs/cupsd.nix | 19 ++++++++++++++++--- upstart-jobs/default.nix | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/upstart-jobs/cupsd.nix b/upstart-jobs/cupsd.nix index 1afd9aae4c28..d67fc384324c 100644 --- a/upstart-jobs/cupsd.nix +++ b/upstart-jobs/cupsd.nix @@ -1,4 +1,4 @@ -{config, pkgs}: +{config, pkgs, modprobe}: let @@ -16,16 +16,24 @@ let bindir = pkgs.runCommand "cups-progs" {} '' ensureDir $out/lib/cups ln -s ${cups}/lib/cups/* $out/lib/cups/ - + + # Provide support for printing via SMB. rm $out/lib/cups/backend ensureDir $out/lib/cups/backend ln -s ${cups}/lib/cups/backend/* $out/lib/cups/backend/ ln -s ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb + + # Provide Ghostscript rasterisation, necessary for non-Postscript + # printers. + rm $out/lib/cups/filter + ensureDir $out/lib/cups/filter + ln -s ${cups}/lib/cups/filter/* $out/lib/cups/filter/ + ln -s ${pkgs.ghostscript}/lib/cups/filter/* $out/lib/cups/filter/ ''; # */ cupsdConfig = pkgs.writeText "cupsd.conf" '' - LogLevel info + LogLevel debug SystemGroup root @@ -96,6 +104,8 @@ in extraPath = [ cups ]; + + job = '' description "CUPS printing daemon" @@ -107,6 +117,9 @@ in mkdir -m 0755 -p ${logDir} mkdir -m 0700 -p /var/cache/cups mkdir -m 0700 -p /var/spool/cups + + # Make USB printers show up. + ${modprobe}/sbin/modprobe usblp || true end script respawn ${cups}/sbin/cupsd -c ${cupsdConfig} -F diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index af304c525748..bd0581b58704 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -301,7 +301,7 @@ let # CUPS (printing) daemon. ++ optional config.services.printing.enable (import ../upstart-jobs/cupsd.nix { - inherit config pkgs; + inherit config pkgs modprobe; }) # Gateway6