1 { config, lib, pkgs, ... }:
7 cfg = config.services.xserver.cmt;
8 etcPath = "X11/xorg.conf.d";
14 services.xserver.cmt = {
18 description = lib.mdDoc "Enable chrome multitouch input (cmt). Touchpad drivers that are configured for chromebooks.";
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" ];
23 description = lib.mdDoc ''
24 Which models to enable cmt for. Enter the Code Name for your Chromebook.
25 Code Name can be found at <https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices>.
31 config = mkIf cfg.enable {
33 services.xserver.modules = [ pkgs.xf86_input_cmt ];
36 "${etcPath}/40-touchpad-cmt.conf" = {
37 source = "${pkgs.chromium-xorg-conf}/40-touchpad-cmt.conf";
39 "${etcPath}/50-touchpad-cmt-${cfg.models}.conf" = {
40 source = "${pkgs.chromium-xorg-conf}/50-touchpad-cmt-${cfg.models}.conf";
42 "${etcPath}/60-touchpad-cmt-${cfg.models}.conf" = {
43 source = "${pkgs.chromium-xorg-conf}/60-touchpad-cmt-${cfg.models}.conf";
49 assertion = !config.services.xserver.libinput.enable;
51 cmt and libinput are incompatible, meaning you cannot enable them both.
52 To use cmt you need to disable libinput with `services.xserver.libinput.enable = false`
53 If you haven't enabled it in configuration.nix, it's enabled by default on a
54 different xserver module.