From 525e4e961d0e132cce50d1bcc6a477164e4434d6 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 2 Apr 2009 15:02:13 +0000 Subject: [PATCH] Added console kit upstart job svn path=/nixos/trunk/; revision=14839 --- system/options.nix | 12 +++++++++++- upstart-jobs/consolekit.nix | 24 ++++++++++++++++++++++++ upstart-jobs/default.nix | 7 +++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 upstart-jobs/consolekit.nix diff --git a/system/options.nix b/system/options.nix index 2828863e9870..cfd81259fffb 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1967,7 +1967,17 @@ in }; }; - + consolekit = { + + enable = mkOption { + default = false; + description = " + Whether to start the ConsoleKit daemon. + "; + }; + + }; + samba = { enable = mkOption { diff --git a/upstart-jobs/consolekit.nix b/upstart-jobs/consolekit.nix new file mode 100644 index 000000000000..fef32159aa6b --- /dev/null +++ b/upstart-jobs/consolekit.nix @@ -0,0 +1,24 @@ +args: with args; + +let + +cfg = config.services.consolekit; + +in +{ + name = "consolekit"; + + job = '' + description "Console Kit Service" + + start on dbus + stop on shutdown + + start script + # !!! quick hack: wait until dbus has started + sleep 3 + end script + + respawn ${pkgs.ConsoleKit}/sbin/console-kit-daemon + ''; +} diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 0f479e406382..95dbb320ea9a 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -350,6 +350,7 @@ let dbusServices = pkgs.lib.optional config.services.hal.enable pkgs.hal ++ pkgs.lib.optional config.services.avahi.enable pkgs.avahi ++ + pkgs.lib.optional config.services.consolekit.enable pkgs.ConsoleKit ++ pkgs.lib.optional config.services.disnix.enable pkgs.disnix ; }) @@ -385,6 +386,12 @@ let inherit config pkgs; }) + # ConsoleKit daemon. + ++ optional config.services.consolekit.enable + (import ../upstart-jobs/consolekit.nix { + inherit config pkgs; + }) + # Postfix mail server. ++ optional config.services.postfix.enable (import ../upstart-jobs/postfix.nix {