git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/cmt: add cmt module

Adds custom touchpad drivers for Chromebooks.

commitfa538528043ee125caf8719540d9c2e7abc97391 authorCalvin Kim <ccychc@gmail.com> dateSun 8 Sep 2019, 03:02 (7 years ago) parent5df0605
3 files changed+63
nixos/modules/module-list.nix+1 nixos/modules/services/x11/hardware/cmt.nix+54 pkgs/top-level/all-packages.nix+8
nixos/modules/module-list.nix+1
@@ -842,6 +842,7 @@
842842 ./services/x11/hardware/multitouch.nix
843843 ./services/x11/hardware/synaptics.nix
844844 ./services/x11/hardware/wacom.nix
845+ ./services/x11/hardware/cmt.nix
845846 ./services/x11/gdk-pixbuf.nix
846847 ./services/x11/redshift.nix
847848 ./services/x11/urxvtd.nix
nixos/modules/services/x11/hardware/cmt.nixnew file+54
@@ -0,0 +1,54 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+
7+cfg = config.services.xserver.cmt;
8+etcPath = "X11/xorg.conf.d";
9+
10+in {
11+
12+ options = {
13+
14+ services.xserver.cmt = {
15+ enable = mkOption {
16+ type = types.bool;
17+ default = false;
18+ description = "Enable chrome multitouch input (cmt). Touchpad drivers that are configured for chromebooks.";
19+ };
20+ models = mkOption {
21+ type = types.enum [ "atlas" "banjo" "candy" "caroline" "cave" "celes" "clapper" "cyan" "daisy" "elan" "elm" "enguarde" "eve" "expresso" "falco" "gandof" "glimmer" "gnawty" "heli" "kevin" "kip" "leon" "lulu" "orco" "pbody" "peppy" "pi" "pit" "puppy" "quawks" "rambi" "samus" "snappy" "spring" "squawks" "swanky" "winky" "wolf" "auron_paine" "auron_yuna" "daisy_skate" "nyan_big" "nyan_blaze" "veyron_jaq" "veyron_jerry" "veyron_mighty" "veyron_minnie" "veyron_speedy" ];
22+ example = "banjo";
23+ description = ''
24+ Which models to enable cmt for. Enter the Code Name for your Chromebook.
25+ Code Name can be found at <link xlink:href="https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices" />.
26+ '';
27+ };
28+ }; #closes services
29+ }; #closes options
30+
31+ config = mkIf cfg.enable {
32+
33+ services.xserver.modules = [ pkgs.xf86_input_cmt ];
34+
35+ environment.etc = {
36+ "${etcPath}/40-touchpad-cmt.conf" = {
37+ source = "${pkgs.chromium-xorg-conf}/40-touchpad-cmt.conf";
38+ };
39+ "${etcPath}/50-touchpad-cmt-${cfg.models}.conf" = {
40+ source = "${pkgs.chromium-xorg-conf}/50-touchpad-cmt-${cfg.models}.conf";
41+ };
42+ "${etcPath}/60-touchpad-cmt-${cfg.models}.conf" = {
43+ source = "${pkgs.chromium-xorg-conf}/60-touchpad-cmt-${cfg.models}.conf";
44+ };
45+ };
46+
47+ assertions = [
48+ {
49+ assertion = !config.services.xserver.libinput.enable;
50+ message = "cmt and libinput are incompatible, you cannot enable both (in services.xserver).";
51+ }
52+ ];
53+ };
54+}
pkgs/top-level/all-packages.nix+8
@@ -9223,6 +9223,8 @@ in
92239223
92249224 chromedriver = callPackage ../development/tools/selenium/chromedriver { gconf = gnome2.GConf; };
92259225
9226+ chromium-xorg-conf = callPackage ../os-specific/linux/chromium-xorg-conf { };
9227+
92269228 chrpath = callPackage ../development/tools/misc/chrpath { };
92279229
92289230 chruby = callPackage ../development/tools/misc/chruby { rubies = null; };
@@ -16435,6 +16437,8 @@ in
1643516437
1643616438 wpa_supplicant_gui = libsForQt5.callPackage ../os-specific/linux/wpa_supplicant/gui.nix { };
1643716439
16440+ xf86_input_cmt = callPackage ../os-specific/linux/xf86-input-cmt { };
16441+
1643816442 xf86_input_mtrack = callPackage ../os-specific/linux/xf86-input-mtrack { };
1643916443
1644016444 xf86_input_multitouch = callPackage ../os-specific/linux/xf86-input-multitouch { };
@@ -16733,6 +16737,10 @@ in
1673316737
1673416738 liberation-sans-narrow = callPackage ../data/fonts/liberation-sans-narrow { };
1673516739
16740+ libevdevc = callPackage ../os-specific/linux/libevdevc { };
16741+
16742+ libgestures = callPackage ../os-specific/linux/libgestures { };
16743+
1673616744 liberastika = callPackage ../data/fonts/liberastika { };
1673716745
1673816746 libertine = callPackage ../data/fonts/libertine { };