🚀 enable asus touchpad numpad

This commit is contained in:
Moritz Böhme 2022-04-18 12:20:04 +02:00
parent 26a7df41d8
commit a00798b058
No known key found for this signature in database
GPG key ID: 213820E2795F5CF5
3 changed files with 50 additions and 1 deletions

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ config, pkgs, inputs, ... }:
{
imports = [
@ -78,6 +78,32 @@
script = "${batteryLevelSufficient}/bin/battery-level-sufficient";
};
# Trackpad
# i2c for https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver
hardware.i2c.enable = true;
systemd.services.asus-touchpad-numpad = {
description =
"Activate Numpad inside the touchpad with top right corner switch";
documentation =
[ "https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver" ];
path = [ pkgs.i2c-tools ];
script = ''
cd ${inputs.asus-touchpad-numpad-driver}
# In the last argument here you choose your layout.
${
pkgs.python3.withPackages (ps: [ ps.libevdev ])
}/bin/python asus_touchpad.py m433ia
'';
# Probably needed because it fails on boot seemingly because the driver
# is not ready yet. Alternativly, you can use `sleep 3` or similar in the
# `script`.
serviceConfig = {
RestartSec = "1s";
Restart = "on-failure";
};
wantedBy = [ "multi-user.target" ];
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave