Help Troubleshooting Mouse Sensitivity in Hyprland on NixOS

I’m running Hyprland wayland compositor on a flake-based NixOS setup. I have a mostly working hyprland.conf (I’m just using the home.file method in home-manager to apply hyprland.conf, which is to say I’m not declaring hyprland settings using nix syntax):

  home.file."${config.xdg.configHome}/hypr" = {
    source = ../dotfiles/hypr;
    recursive = true;
  };

The output of hyprctl devices on my system outputs the following:

mice:
Mouse at 1cbd000:
synps/2-synaptics-touchpad
default speed: 0.00000
Mouse at 1cbddc0:
tpps/2-alps-trackpoint
default speed: 0.00000
Mouse at 1a64240:
razer-proclickm-mouse
default speed: 0.00000
Mouse at 17fa9c0:
razer-proclickm-keyboard-1
default speed: 0.00000
Mouse at 19fff00:
razer-proclickm-1
default speed: 0.00000

The device section of my hyprland.conf, following the instructions on the wiki - Keywords – Hyprland Wiki - looks like this:

device {
  name = razer-proclickm-1
  sensitivity = -0.5
}

This works exactly as it should on my Arch system running hyprland Unfortunately, this has no effect on my NixOS system and I’ve been struggling to figure out why.

For what its worth, I’ve also tried with the other two razer mouse names (razer-proclickm-keyboard-1 and razer-proclickm-mouse), both individually and in combination with razer-proclickm-1 in the device {} block to no effect. The touchpad and trackpoint items have no effect either (not even on the actual trackpad and trackpoint sensitivity of my laptop).

Also for reference, although I’m not sure it should have any effect on what I’m trying to do specifically, here is the input section of my hyprland.conf:

input {
  kb_layout = us
  repeat_delay = 300
  repeat_rate = 50
  follow_mouse = 1
  sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
  touchpad {
    natural_scroll = true
    disable_while_typing = true
  }
}

Changing the sensitivity setting in either device and/or input sections has no effect. Can anyone help me troubleshoot this?

I seem to having the same issues. Happy to add additional details if clarity is needed for reaching a solution. As far as I can tell my setup is basically the same.

Since my original post, I went ahead an translated my entire hyprland.conf into nix syntax for the home-manager module. I found that the device settings still don’t work when deployed in the settings block of the module, however if I put them in the extraConfig block they finally start working. Here is a snippet of my extraConfig module in relation to the top-level wayland.windowManager.hyprland syntax in case helpful:

  wayland.windowManager.hyprland = {
    enable = true;
    settings = {
      "$mod" = "Alt";
      more settings blah, blah ....
    };
    extraConfig = ''
      device {
        name=razer-proclickm
        sensitivity=-0.5
      }
      device {
        name=razer-proclickm-1
        sensitivity=-0.5
      }
    '';

I found that sometimes my mouse shows up under two different names identified by hyprctl devices when plugged/unplugged, so that is why I put both names in the device section since it seems to be random which one it chooses on an unplug/plug cycle…