How do I get a newer libinput?

I’m setting my laptop up to run NixOS 18.3 stable. It currently pulls in libinput 1.9.4. Since that version was released, they have made a number of changes to their hysteresis code, which I would like to have on my system.

I have tried a handful of wrong ways to upgrade the version, all of which have been rejected by nixos-rebuild. So what’s the correct way to upgrade libinput to, say, 1.11.1?

1 Like

I also use a newer version of libinput, since it contains a vital bug fix for my system. The following works for me:

nixpkgs.config.packageOverrides = pkgs:
    libinput = pkgs.libinput.overrideAttrs (oldAttrs: rec {
      name = "libinput-${version}";
        version = "1.11.1";
        src = pkgs.fetchurl {
          url = "${name}.tar.xz";
          sha256 = "1z7i8vk0i61npkdqwsk85wp9v4yjlvylqnyydikjqnbsrjp9abk4";

The sha256 hash (don’t trust the hash I put there!) can be calculated by running:
nix-prefetch-url will also output the nix store path of the downloaded file.
You may want to check the pgp signature on that file (

Also note, that lots of heavy software has dependencies on libinput. Be prepared for your box to recompile Qt for example.

1 Like

I would recommend just switching to nixos-unstable channel. For desktop
use, it is much more reliable since newer software will fix most of the
bugs you will encounter on release branch.

1 Like

In general you are right. But the libinput version in nixos-unstable is still 1.10.3 atm.

Thanks xaverdh. Looks like the string interpolating $ signs were stripped from your post, but I figured it out and nixos-rebuild test is busy recompiling things now.

1 Like

Note 1.11.0 has been merged libinput: 1.10.3 -> 1.11.0 by colemickens · Pull Request #41974 · NixOS/nixpkgs · GitHub