diff --git a/system/options.nix b/system/options.nix index 69f4971e833f..9be4ce1c3847 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2024,6 +2024,21 @@ }; }; + gpm = { + enable = mkOption { + default = false; + description = " + Whether to enable general purpose mouse daemon. + "; + }; + protocol = mkOption { + default = "ps/2"; + description = " + Mouse protocol to use. + "; + }; + }; + }; installer = { diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 9f2c0f1b14da..d16b5b160840 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -365,6 +365,12 @@ let inherit (pkgs) stdenv hal; }) + ++ optional config.services.gpm.enable + (import ../upstart-jobs/gpm.nix { + inherit (pkgs) gpm; + gpmConfig = config.services.gpm; + }) + # Nagios system/network monitoring daemon. ++ optional config.services.nagios.enable (import ../upstart-jobs/nagios { diff --git a/upstart-jobs/gpm.nix b/upstart-jobs/gpm.nix new file mode 100644 index 000000000000..798ad4041ebd --- /dev/null +++ b/upstart-jobs/gpm.nix @@ -0,0 +1,17 @@ +{gpm, gpmConfig}: + +let + gpmBin = "${gpm}/sbin/gpm"; + +in +{ + name = "gpm"; + job = '' + description = "General purpose mouse" + + start on udev + stop on shutdown + + respawn ${gpmBin} -m /dev/input/mice -t ${gpmConfig.protocol} -D &>/dev/null + ''; +}