Skip to content

Instantly share code, notes, and snippets.

@Aeva
Last active April 16, 2024 16:59
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 Aeva/ac46c616177d8a9407323ab6e00849bf to your computer and use it in GitHub Desktop.
Save Aeva/ac46c616177d8a9407323ab6e00849bf to your computer and use it in GitHub Desktop.
how to swap insert and delete keys on nixos

First, scan through these helpful links:

This is what I ended up adding to /etc/nixos/configure.nx file. This is specific to the keyboard that is in my laptop. Unless you also have the same basic US keyboard they shiped with my framework 13 (circa April 2024), you will want to modify this udev rule accordingly. The information on how to do that can be found in the reddit post and 60-evdev.hwdb file linked above.

  services.udev.extraHwdb = ''
    # This swaps the position of the insert and delete keys, but only
    # for this laptop's keyboard in specific.
    # I: Bus=0011 Vendor=0001 Product=0001 Version=ab83
    # N: Name="AT Translated Set 2 keyboard"
    #evdev:input:b0011v0001p0001eAB83*
    evdev:name:AT Translated Set 2 keyboard:*
      KEYBOARD_KEY_d2=delete
      KEYBOARD_KEY_d3=insert
    '';

Once you're all set and filled with excessive confidence, run the usual sudo nixos-rebuild switch and reboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment