Convert "printing", CUPS daemon

svn path=/nixos/branches/fix-style/; revision=14384
This commit is contained in:
Marc Weber 2009-03-06 12:26:46 +00:00
parent 4d0761beb2
commit d0733953e1
3 changed files with 61 additions and 46 deletions

View File

@ -479,18 +479,6 @@ in
};
printing = {
enable = mkOption {
default = false;
description = "
Whether to enable printing support through the CUPS daemon.
";
};
};
udev = {
addFirmware = mkOption {
@ -1026,6 +1014,7 @@ in
(import ../upstart-jobs/httpd.nix) # Apache httpd (probably this can be removed ?)
(import ../upstart-jobs/apache-httpd) # Apache httpd (new style).
(import ../upstart-jobs/vsftpd.nix)
(import ../upstart-jobs/cupsd.nix) # CUPS printing daemon
# nix
(import ../upstart-jobs/nix.nix) # nix options and daemon

View File

@ -1,4 +1,26 @@
{config, pkgs, modprobe}:
{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
options = {
services = {
printing = {
enable = mkOption {
default = false;
description = "
Whether to enable printing support through the CUPS daemon.
";
};
};
};
};
in
###### implementation
let
@ -7,6 +29,8 @@ let
inherit (pkgs) cups;
modprobe = config.system.sbin.modprobe;
# Here we can enable additional backends, filters, etc. that are not
# part of CUPS itself, e.g. the SMB backend is part of Samba. Since
@ -101,7 +125,14 @@ let
in
{
mkIf config.services.pulseaudio.enable {
require = [
options
];
services = {
extraJobs = [{
name = "cupsd";
extraPath = [cups];
@ -133,5 +164,6 @@ in
respawn ${cups}/sbin/cupsd -c ${cupsdConfig} -F
'';
}];
};
}

View File

@ -166,12 +166,6 @@ let
inherit (pkgs) glibc samba;
})
# CUPS (printing) daemon.
++ optional config.services.printing.enable
(import ../upstart-jobs/cupsd.nix {
inherit config pkgs modprobe;
})
# X Font Server
++ optional config.services.xfs.enable
(import ../upstart-jobs/xfs.nix {