Created
December 25, 2020 07:37
-
-
Save aaronjanse/107db3b8f48853ff5fc4c5b4cce66843 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, pkgconfig, fetchurl, xwiimote, udev, xorg }: | |
stdenv.mkDerivation rec { | |
name = "xf86-input-xwiimote"; | |
src = fetchurl { | |
url = "https://github.com/dvdhrm/xf86-input-xwiimote/releases/download/${name}-0.5/${name}-0.5.tar.xz"; | |
sha256 = "1gwnbnhybrmhmrp4i2b5yr624mvrr9bpk0r2592y8rm7c5lzqfba"; | |
}; | |
nativeBuildInputs = [ pkgconfig ]; | |
buildInputs = with xorg; [ xwiimote udev xorgserver ]; | |
# preConfigure = '' | |
# mkdir -p $out/share/X11/xorg.conf.d | |
# configureFlags="--with-xorg-module-dir=$out/lib/xorg/modules | |
# --with-sdkdir=$out/include/xorg --with-xorg-conf-dir=$out/share/X11/xorg.conf.d" | |
# ''; | |
patchPhase = '' | |
sed -i 's#motion = "";#motion = "motionplus";#g' src/xwiimote.c | |
''; | |
meta = { | |
homepage = http://dvdhrm.github.io/xwiimote; | |
description = "X.Org Wii Remote Input Driver"; | |
platforms = stdenv.lib.platforms.linux; | |
}; | |
postInstallPhase = '' | |
# mkdir -p "$out/share/X11/xorg.conf.d/" | |
# cp "60-xorg-xwiimote.conf" "$out/share/X11/xorg.conf.d/60-xorg-xwiimote.conf" | |
cat > $out/share/X11/xorg.conf.d/60-xorg-xwiimote.conf << EOF | |
Section "InputClass" | |
Identifier "Nintendo Wii Remote" | |
MatchProduct "Nintendo Wii Remote" | |
MatchDevicePath "/dev/input/event*" | |
Option "Ignore" "off" | |
Driver "xwiimote" | |
EndSection | |
Section "InputClass" | |
Identifier "Nintendo Wii Remote Classic Controller Whitelist" | |
MatchProduct "Nintendo Wii Remote Classic Controller" | |
MatchDevicePath "/dev/input/event*" | |
Option "Ignore" "off" | |
Driver "evdev" | |
EndSection | |
Section "InputClass" | |
Identifier "Nintendo Wii Remote Pro Controller Whitelist" | |
MatchProduct "Nintendo Wii Remote Pro Controller" | |
MatchDevicePath "/dev/input/event*" | |
Option "Ignore" "off" | |
Driver "evdev" | |
EndSection | |
EOF | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment