mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 08:34:50 +00:00
5ebdee3577
those that run daemons) to modules/services. This probably broke some things since there are a few relative paths in modules (e.g. imports of system/ids.nix). * Moved some PAM modules out of etc/pam.d to the directories of NixOS modules that use them. svn path=/nixos/branches/modular-nixos/; revision=15717
60 lines
911 B
Nix
60 lines
911 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 = [
|
|
#../upstart-jobs/default.nix # config.services.extraJobs
|
|
#../upstart-jobs/dbus.nix # services.dbus.*
|
|
options
|
|
];
|
|
|
|
services = {
|
|
extraJobs = [job];
|
|
|
|
dbus = {
|
|
enable = true;
|
|
services = [ConsoleKit];
|
|
};
|
|
};
|
|
}
|