From 5dffe7eebfcc164d93671033860a7aaea4360ee4 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sat, 25 Nov 2023 20:13:41 +1100 Subject: [PATCH] extest: init at 1.0.2 --- nixos/modules/programs/steam.nix | 11 +++++++++++ pkgs/by-name/ex/extest/package.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/by-name/ex/extest/package.nix diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index c7f1e622f7ba..a52dfca67e1c 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -56,6 +56,8 @@ in { # use the setuid wrapped bubblewrap bubblewrap = "${config.security.wrapperDir}/.."; }; + } // optionalAttrs cfg.extest.enable { + extraEnv.LD_PRELOAD = "${pkgs.pkgsi686Linux.extest}/lib/libextest.so"; }); description = lib.mdDoc '' The Steam package to use. Additional libraries are added from the system @@ -114,6 +116,15 @@ in { }; }; }; + + extest.enable = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Load the extest library into Steam, to translate X11 input events to + uinput events (e.g. for using Steam Input on Wayland) + ''; + }; }; config = mkIf cfg.enable { diff --git a/pkgs/by-name/ex/extest/package.nix b/pkgs/by-name/ex/extest/package.nix new file mode 100644 index 000000000000..a0df42265da5 --- /dev/null +++ b/pkgs/by-name/ex/extest/package.nix @@ -0,0 +1,26 @@ +{ lib +, fetchFromGitHub +, rustPlatform +}: + +rustPlatform.buildRustPackage rec { + pname = "extest"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "Supreeeme"; + repo = "extest"; + rev = version; + hash = "sha256-qdTF4n3uhkl3WFT+7bAlwCjxBx3ggTN6i3WzFg+8Jrw="; + }; + + cargoHash = "sha256-JZPiTzr9KaaqiXKhsGOYmYMtjNzPQzKhqyfSlbeqME8="; + + meta = with lib; { + description = "X11 XTEST reimplementation primarily for Steam Controller on Wayland"; + homepage = "https://github.com/Supreeeme/extest"; + platforms = platforms.linux; + license = licenses.mit; + maintainers = [ maintainers.puffnfresh ]; + }; +}