nixpkgs/upstart-jobs/consolekit.nix
Nicolas Pierron 16a916f297 * Synced with trunk @ 14905
svn path=/nixos/branches/modular-nixos/; revision=14986
2009-04-11 22:12:02 +00:00

60 lines
927 B
Nix

{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption;
options = {
services = {
consolekit = {
enable = mkOption {
default = false;
description = "
Whether to start the ConsoleKit daemon.
";
};
};
};
};
in
###### implementation
let
cfg = config.services.consolekit;
inherit (pkgs.lib) mkIf;
inherit (pkgs) ConsoleKit;
job = {
name = "consolekit";
job = ''
description "Console Kit Service"
start on dbus
stop on shutdown
respawn ${ConsoleKit}/sbin/console-kit-daemon
'';
};
in
mkIf cfg.enable {
require = [
(import ../upstart-jobs/default.nix) # config.services.extraJobs
(import ../upstart-jobs/dbus.nix) # services.dbus.*
options
];
services = {
extraJobs = [job];
dbus = {
enable = true;
services = [ConsoleKit];
};
};
}