Skip to content

Instantly share code, notes, and snippets.

@sheijk
Created April 3, 2021 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheijk/f9781cde5641e5bccbecfcbd61b3ebf6 to your computer and use it in GitHub Desktop.
Save sheijk/f9781cde5641e5bccbecfcbd61b3ebf6 to your computer and use it in GitHub Desktop.
evdevremapper systemd service on nixos
devices:
- input_name: 'AT Translated Set 2 keyboard'
output_name: 'AT Translated Set 2 keyboard remapped'
remappings:
# Fix key right of left shift
KEY_102ND:
- KEY_GRAVE
# more omitted as it doesn't change the issue
systemd.user.services."keyboard-remapping" = {
enable = true;
path = [pkgs.evdevremapkeys];
wantedBy = [ "default.target" ];
serviceConfig = {
WorkingDirectory = "/tmp";
ExecStart = "${pkgs.evdevremapkeys}/bin/evdevremapkeys -f /etc/nixos/keyboard/config.yaml";
Restart = "always";
PrivateTmp = true;
NoNewPrivileges = true;
};
};
Apr 03 02:37:40 nixos evdevremapkeys[1119]: File "/nix/store/z3m2k16zbhj18kh3rmzyh977j1i20da3-python3.8-evdevremapkeys-0.1.0/lib/python3.8/site-packages/evdevremapkeys/evdevremapkeys.py", line 262, in register_device
Apr 03 02:37:40 nixos evdevremapkeys[1119]: raise NameError("Can't find input device")
Apr 03 02:37:40 nixos evdevremapkeys[1119]: NameError: Can't find input device
Running the same in a shell (without systemd) works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment