2021-10-07 14:46:35 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev, acl }:
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "joycond";
|
2021-10-07 14:46:35 +00:00
|
|
|
version = "unstable-2021-07-30";
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "DanielOgorchock";
|
|
|
|
repo = "joycond";
|
2021-10-07 14:46:35 +00:00
|
|
|
rev = "f9a66914622514c13997c2bf7ec20fa98e9dfc1d";
|
|
|
|
sha256 = "sha256-quw7yBHDDZk1+6uHthsfMCej7g5uP0nIAqzvI6436B8=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
buildInputs = [ libevdev udev ];
|
|
|
|
|
|
|
|
# CMake has hardcoded install paths
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,etc/{systemd/system,udev/rules.d},lib/modules-load.d}
|
|
|
|
|
|
|
|
cp ./joycond $out/bin
|
|
|
|
cp $src/udev/{89,72}-joycond.rules $out/etc/udev/rules.d
|
|
|
|
cp $src/systemd/joycond.service $out/etc/systemd/system
|
|
|
|
cp $src/systemd/joycond.conf $out/lib/modules-load.d
|
|
|
|
|
|
|
|
substituteInPlace $out/etc/systemd/system/joycond.service --replace \
|
|
|
|
"ExecStart=/usr/bin/joycond" "ExecStart=$out/bin/joycond"
|
2021-10-07 14:46:35 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/etc/udev/rules.d/89-joycond.rules --replace \
|
|
|
|
"/bin/setfacl" "${acl}/bin/setfacl"
|
2021-04-08 16:26:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/DanielOgorchock/joycond";
|
|
|
|
description = "Userspace daemon to combine joy-cons from the hid-nintendo kernel driver";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "joycond";
|
2021-04-08 16:26:57 +00:00
|
|
|
license = licenses.gpl3Only;
|
2024-07-01 15:47:52 +00:00
|
|
|
maintainers = [ ];
|
2021-04-08 16:26:57 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|