This is a Nix flake that installs and configures xremap.
Flake allows running xremap as a system-wide service and as a user service (controlled by services.xremap.serviceMode
option).
Flake implements xremap features that allow specifying per-application remapping. Following combinations are tested:
Scenario | No features | Sway | Gnome | X11 | Hyprland |
---|---|---|---|---|---|
System | ✔️ | ✔️* |
✖️ | ❓ | ✖️** |
User | ✔️ | ✔️ | ✔️ | ❓ | ✔️ |
✔️ – tested, works ✖️ – not implemented ❓ – not tested
*
: Sway system mode requires restarting the system service after user logs in for the service to pick up the Sway socket.
**
: Hyprland feature can be enabled, but the service cannot find a socket
-
Add following to your
flake.nix
:{ inputs.xremap-flake.url = "github:xremap/nix-flake"; }
-
Import the
xremap-flake.nixosModules.default
module. -
Configure the module options
Alternatively, flake application can be nix run
to launch xremap without features.
Following services.xremap
options are exposed:
serviceMode
– whether to run as user or systemwithSway
– whether to enable Sway supportwithGnome
– whether to enable Gnome supportwithX11
– whether to enable X11 supportpackage
– which package for xremap to useconfig
– configuration for xremap defined as Nix attribute set. See original repo for examples.userId
– user under which Sway IPC socket runsuserName
– Name of user logging into graphical sessiondeviceName
– the name of the device to be used. To find out the name, you can check/proc/bus/input/devices
watch
– whether to watch for new devices
See examples in nixosConfigurations
inside flake.nix.
The nix flake comes with a few VM presets that can be used to test some of the combinations. To run a specific VM:
nix run '.#nixosConfigurations.hyprland-user-dev.config.system.build.vm
where hyprland-user-dev
is the name of the nixosConfiguration
you want to launch