Libinput Quirks in NixOS

I am in the process of switching from Fedora to NixOS.
My laptop had an issue where the stylus would not rotate together with the screen.

I solved it by creating a /etc/libwacom/google-jinlon.tablet file and /etc/libinput/local-overrides.quirks files.

Now, I am trying to do the same in my nix config, but it doesn’t work. The files get linked correctly, but the stylus rotation is still broken. I am unsure where the issue is. Am I missing something in my configuration? Is it an issue with the symlinks? I am aware of the services. server.wacom.enable option, but I am using Wayland, and this option only affects X11.

{ config, pkgs, ... }:

{
  environment.etc = {
    "libwacom/google-jinlon.tablet".text = ''
[Device]
Name=GDIX0000:00 27C6:0E0C Stylus
ModelName=
DeviceMatch=i2c:27c6:0e0c
Class=ISDV4
Width=9
Height=5
IntegratedIn=Display;System
#Styli=isdv4-aes
Styli=@generic-no-eraser

[Features]
Stylus=true
Touch=false'';

    "libinput/local-overrides.quirks".text = ''
[Google Chromebook Jinlon Stylus Digitizer]
MatchUdevType=tablet
MatchDeviceTree=*jinlon*
MatchBus=i2c
ModelChromebook=1
AttrPressureRange=1100:1000'';
  };
}
1 Like

Our libinput package supported this for a while now but it does not appear to be supported by our libwacom package. It would need similar fix (also discussed here). Edit: libwacom now supports loading quirks from /etc too.

Thanks for your response i’ll test the suggestions in this thread.

@Xelef2000 were you able to get this to work? I tried adding the following to my configuration.nix file like in that github thread alluded to, but it looks like that option doesn’t exist:

      services.xserver.libinput.quirks = [
      ''
      [Touchpad touch size override]
      MatchUdevType=touchpad
      MatchName=*bcm5974
      MatchDMIModalias=dmi:*:*:*:*:svnAppleInc.:pnMacBookAir6,2*
      AttrPressureRange=150:130,AttrPalmSizeThreshold=500
      ''];

You need to use environment.etc option as in the OP.

1 Like

Thanks for the tip! The following looks like it’s working:

  environment.etc."libinput/local-overrides.quirks".text = pkgs.lib.mkForce ''
      [Touchpad touch size override]
      MatchUdevType=touchpad
      MatchName=*bcm5974
      MatchDMIModalias=dmi:*:*:*:*:svnAppleInc.:pnMacBookAir6,2*
      AttrTouchSizeRange=77:57
      AttrPressureRange=55:25
      AttrPalmSizeThreshold=600
  '';
1 Like

Thanks, this helped me fix this issue: Keyd neuters libinput's "disable while typing" for touchpads · Issue #66 · rvaiya/keyd · GitHub

  environment.etc."libinput/local-overrides.quirks".text = pkgs.lib.mkForce ''
    [Serial Keyboards]
    MatchUdevType=keyboard
    MatchName=keyd virtual keyboard
    AttrKeyboardIntegration=internal
  '';
1 Like