Merge pull request #139502 from Vodurden/nixos-unstable
Support virtual Nintendo Switch Pro controllers in joycond
This commit is contained in:
commit
043bc8a984
|
@ -321,6 +321,14 @@
|
|||
<link linkend="opt-programs.pantheon-tweaks.enable">programs.pantheon-tweaks</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/DanielOgorchock/joycond">joycond</link>,
|
||||
a service that uses <literal>hid-nintendo</literal> to provide
|
||||
nintendo joycond pairing and better nintendo switch pro
|
||||
controller support.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-21.11-incompatibilities">
|
||||
|
|
|
@ -99,6 +99,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||
|
||||
- [pantheon-tweaks](https://github.com/pantheon-tweaks/pantheon-tweaks), an unofficial system settings panel for Pantheon. Available as [programs.pantheon-tweaks](#opt-programs.pantheon-tweaks.enable).
|
||||
|
||||
- [joycond](https://github.com/DanielOgorchock/joycond), a service that uses `hid-nintendo` to provide nintendo joycond pairing and better nintendo switch pro controller support.
|
||||
|
||||
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||
|
||||
- The `security.wrappers` option now requires to always specify an owner, group and whether the setuid/setgid bit should be set.
|
||||
|
|
|
@ -412,6 +412,7 @@
|
|||
./services/hardware/illum.nix
|
||||
./services/hardware/interception-tools.nix
|
||||
./services/hardware/irqbalance.nix
|
||||
./services/hardware/joycond.nix
|
||||
./services/hardware/lcd.nix
|
||||
./services/hardware/lirc.nix
|
||||
./services/hardware/nvidia-optimus.nix
|
||||
|
|
40
nixos/modules/services/hardware/joycond.nix
Normal file
40
nixos/modules/services/hardware/joycond.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.joycond;
|
||||
kernelPackages = config.boot.kernelPackages;
|
||||
in
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.services.joycond = {
|
||||
enable = mkEnableOption "support for Nintendo Pro Controllers and Joycons";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.joycond;
|
||||
defaultText = "pkgs.joycond";
|
||||
description = ''
|
||||
The joycond package to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
kernelPackages.hid-nintendo
|
||||
cfg.package
|
||||
];
|
||||
|
||||
boot.extraModulePackages = [ kernelPackages.hid-nintendo ];
|
||||
boot.kernelModules = [ "hid_nintendo" ];
|
||||
|
||||
services.udev.packages = [ cfg.package ];
|
||||
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/81138
|
||||
systemd.services.joycond.wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev }:
|
||||
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev, acl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "joycond";
|
||||
version = "unstable-2021-03-27";
|
||||
version = "unstable-2021-07-30";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DanielOgorchock";
|
||||
repo = "joycond";
|
||||
rev = "2d3f553060291f1bfee2e49fc2ca4a768b289df8";
|
||||
sha256 = "0dpmwspll9ar3pxg9rgnh224934par8h8bixdz9i2pqqbc3dqib7";
|
||||
rev = "f9a66914622514c13997c2bf7ec20fa98e9dfc1d";
|
||||
sha256 = "sha256-quw7yBHDDZk1+6uHthsfMCej7g5uP0nIAqzvI6436B8=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
|
@ -25,6 +25,9 @@ stdenv.mkDerivation rec {
|
|||
|
||||
substituteInPlace $out/etc/systemd/system/joycond.service --replace \
|
||||
"ExecStart=/usr/bin/joycond" "ExecStart=$out/bin/joycond"
|
||||
|
||||
substituteInPlace $out/etc/udev/rules.d/89-joycond.rules --replace \
|
||||
"/bin/setfacl" "${acl}/bin/setfacl"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue