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