Convert "gpm" upstart-job to the fix-style.

svn path=/nixos/branches/fix-style/; revision=13376
This commit is contained in:
Nicolas Pierron 2008-11-23 01:28:45 +00:00
parent afe160c6b2
commit 585fd9d911
3 changed files with 52 additions and 32 deletions

View file

@ -2259,22 +2259,6 @@ in
}; };
gpm = {
enable = mkOption {
default = false;
description = "
Whether to enable general purpose mouse daemon.
";
};
protocol = mkOption {
default = "ps/2";
description = "
Mouse protocol to use.
";
};
};
postfix = { postfix = {
enable = mkOption { enable = mkOption {
default = false; default = false;
@ -3035,6 +3019,7 @@ root ALL=(ALL) SETENV: ALL
(import ../upstart-jobs/pcmcia.nix) (import ../upstart-jobs/pcmcia.nix)
# services # services
(import ../upstart-jobs/gpm.nix)
(import ../upstart-jobs/nagios/default.nix) (import ../upstart-jobs/nagios/default.nix)
(import ../upstart-jobs/zabbix-agent.nix) (import ../upstart-jobs/zabbix-agent.nix)
(import ../upstart-jobs/zabbix-server.nix) (import ../upstart-jobs/zabbix-server.nix)

View file

@ -406,12 +406,6 @@ let
inherit (pkgs) stdenv hal; inherit (pkgs) stdenv hal;
}) })
++ optional config.services.gpm.enable
(import ../upstart-jobs/gpm.nix {
inherit (pkgs) gpm;
gpmConfig = config.services.gpm;
})
# Postfix mail server. # Postfix mail server.
++ optional config.services.postfix.enable ++ optional config.services.postfix.enable
(import ../upstart-jobs/postfix.nix { (import ../upstart-jobs/postfix.nix {

View file

@ -1,17 +1,58 @@
{gpm, gpmConfig}: {pkgs, config}:
###### interface
let let
inherit (pkgs.lib) mkOption;
options = {
services = {
gpm = {
enable = mkOption {
default = false;
description = "
Whether to enable general purpose mouse daemon.
";
};
protocol = mkOption {
default = "ps/2";
description = "
Mouse protocol to use.
";
};
};
};
};
in
###### implementation
let
cfg = config.services.gpm;
ifEnable = pkgs.lib.ifEnable cfg.enable;
gpm = pkgs.gpm;
gpmBin = "${gpm}/sbin/gpm"; gpmBin = "${gpm}/sbin/gpm";
job = {
name = "gpm";
job = ''
description = "General purpose mouse"
start on udev
stop on shutdown
respawn ${gpmBin} -m /dev/input/mice -t ${cfg.protocol} -D &>/dev/null
'';
};
in in
{ {
name = "gpm"; require = [
job = '' (import ../upstart-jobs/default.nix) # config.services.extraJobs
description = "General purpose mouse" # /etc/security/console.perms (should be generated ?)
options
];
start on udev services = {
stop on shutdown extraJobs = ifEnable [job];
};
respawn ${gpmBin} -m /dev/input/mice -t ${gpmConfig.protocol} -D &>/dev/null
'';
} }