2009-04-12 00:12:02 +02:00
|
|
|
{pkgs, config, ...}:
|
2009-04-02 17:02:13 +02:00
|
|
|
|
2009-04-12 00:12:02 +02:00
|
|
|
###### interface
|
2009-04-02 17:02:13 +02:00
|
|
|
let
|
2009-04-12 00:12:02 +02:00
|
|
|
inherit (pkgs.lib) mkOption;
|
2009-04-02 17:02:13 +02:00
|
|
|
|
2009-04-12 00:12:02 +02:00
|
|
|
options = {
|
|
|
|
services = {
|
2009-04-02 17:02:13 +02:00
|
|
|
|
2009-04-12 00:12:02 +02:00
|
|
|
consolekit = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether to start the ConsoleKit daemon.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
2009-04-02 17:02:13 +02:00
|
|
|
in
|
2009-04-12 00:12:02 +02:00
|
|
|
|
|
|
|
###### implementation
|
|
|
|
let
|
|
|
|
cfg = config.services.consolekit;
|
|
|
|
inherit (pkgs.lib) mkIf;
|
|
|
|
inherit (pkgs) ConsoleKit;
|
|
|
|
|
|
|
|
job = {
|
2009-04-02 17:02:13 +02:00
|
|
|
name = "consolekit";
|
2009-04-12 00:12:02 +02:00
|
|
|
|
2009-04-02 17:02:13 +02:00
|
|
|
job = ''
|
|
|
|
description "Console Kit Service"
|
|
|
|
|
|
|
|
start on dbus
|
2009-04-12 00:12:02 +02:00
|
|
|
stop on shutdown
|
|
|
|
|
|
|
|
respawn ${ConsoleKit}/sbin/console-kit-daemon
|
2009-04-02 17:02:13 +02:00
|
|
|
'';
|
2009-04-12 00:12:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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];
|
|
|
|
};
|
|
|
|
};
|
2009-04-02 17:02:13 +02:00
|
|
|
}
|