{
  pkgs,
  inputs,
  lib,
  ...
}: {
  imports = [
    inputs.xremap.nixosModules.default
  ];

  hardware.uinput.enable = true;
  users.groups.uinput.members = ["ghoscht"];
  users.groups.input.members = ["ghoscht"];

  systemd.user.services.set-xhost = {
    description = "Run a one-shot command upon user login";
    path = [pkgs.xorg.xhost];
    wantedBy = ["default.target"];
    script = "xhost +SI:localuser:root";
    environment.DISPLAY = ":0"; # NOTE: This is hardcoded for this flake
  };

  services.xremap = {
    withX11 = true;
    watch = true;
    debug = false;
    userName = "ghoscht";
    serviceMode = "user";
    config = {
      keymap = [
        {
          name = "Global";
          remap = {
            "CapsLock" = "Esc";
            "Esc" = "CapsLock";
            super-x = {
              launch = ["${lib.getExe pkgs.wezterm}"];
            };
            # super-space = {
            #   launch = ["${lib.getExe pkgs.rofi}" "-i" "-show" "drun" "-show-icons"];
            # };
            # super-control-l = {
            #   launch = ["${lib.getExe pkgs.firefox}"];
            # };
            # super-control-shift-l = {
            #   launch = ["${lib.getExe pkgs.firefox}" "--private-window"];
            # };
          };
        }
        {
          name = "Music";
          remap = {
            "KEY_PLAYPAUSE" = {
              launch = ["${lib.getExe pkgs.playerctl}" "play-pause"];
            };
            "KEY_NEXTSONG" = {
              launch = ["${lib.getExe pkgs.playerctl}" "next"];
            };
            "KEY_PREVIOUSSONG" = {
              launch = ["${lib.getExe pkgs.playerctl}" "previous"];
            };
          };
        }
      ];
    };
  };
}