Merge pull request #139502 from Vodurden/nixos-unstable

Support virtual Nintendo Switch Pro controllers in joycond

authored by

Timo Kaufmann and committed by
GitHub
043bc8a9 526221d0

+58 -4
+8
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
··· 321 <link linkend="opt-programs.pantheon-tweaks.enable">programs.pantheon-tweaks</link>. 322 </para> 323 </listitem> 324 </itemizedlist> 325 </section> 326 <section xml:id="sec-release-21.11-incompatibilities">
··· 321 <link linkend="opt-programs.pantheon-tweaks.enable">programs.pantheon-tweaks</link>. 322 </para> 323 </listitem> 324 + <listitem> 325 + <para> 326 + <link xlink:href="https://github.com/DanielOgorchock/joycond">joycond</link>, 327 + a service that uses <literal>hid-nintendo</literal> to provide 328 + nintendo joycond pairing and better nintendo switch pro 329 + controller support. 330 + </para> 331 + </listitem> 332 </itemizedlist> 333 </section> 334 <section xml:id="sec-release-21.11-incompatibilities">
+2
nixos/doc/manual/release-notes/rl-2111.section.md
··· 99 100 - [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). 101 102 ## Backward Incompatibilities {#sec-release-21.11-incompatibilities} 103 104 - The `security.wrappers` option now requires to always specify an owner, group and whether the setuid/setgid bit should be set.
··· 99 100 - [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). 101 102 + - [joycond](https://github.com/DanielOgorchock/joycond), a service that uses `hid-nintendo` to provide nintendo joycond pairing and better nintendo switch pro controller support. 103 + 104 ## Backward Incompatibilities {#sec-release-21.11-incompatibilities} 105 106 - The `security.wrappers` option now requires to always specify an owner, group and whether the setuid/setgid bit should be set.
+1
nixos/modules/module-list.nix
··· 412 ./services/hardware/illum.nix 413 ./services/hardware/interception-tools.nix 414 ./services/hardware/irqbalance.nix 415 ./services/hardware/lcd.nix 416 ./services/hardware/lirc.nix 417 ./services/hardware/nvidia-optimus.nix
··· 412 ./services/hardware/illum.nix 413 ./services/hardware/interception-tools.nix 414 ./services/hardware/irqbalance.nix 415 + ./services/hardware/joycond.nix 416 ./services/hardware/lcd.nix 417 ./services/hardware/lirc.nix 418 ./services/hardware/nvidia-optimus.nix
+40
nixos/modules/services/hardware/joycond.nix
···
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + let 4 + cfg = config.services.joycond; 5 + kernelPackages = config.boot.kernelPackages; 6 + in 7 + 8 + with lib; 9 + 10 + { 11 + options.services.joycond = { 12 + enable = mkEnableOption "support for Nintendo Pro Controllers and Joycons"; 13 + 14 + package = mkOption { 15 + type = types.package; 16 + default = pkgs.joycond; 17 + defaultText = "pkgs.joycond"; 18 + description = '' 19 + The joycond package to use. 20 + ''; 21 + }; 22 + }; 23 + 24 + config = mkIf cfg.enable { 25 + environment.systemPackages = [ 26 + kernelPackages.hid-nintendo 27 + cfg.package 28 + ]; 29 + 30 + boot.extraModulePackages = [ kernelPackages.hid-nintendo ]; 31 + boot.kernelModules = [ "hid_nintendo" ]; 32 + 33 + services.udev.packages = [ cfg.package ]; 34 + 35 + systemd.packages = [ cfg.package ]; 36 + 37 + # Workaround for https://github.com/NixOS/nixpkgs/issues/81138 38 + systemd.services.joycond.wantedBy = [ "multi-user.target" ]; 39 + }; 40 + }
+7 -4
pkgs/os-specific/linux/joycond/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev }: 2 3 stdenv.mkDerivation rec { 4 pname = "joycond"; 5 - version = "unstable-2021-03-27"; 6 7 src = fetchFromGitHub { 8 owner = "DanielOgorchock"; 9 repo = "joycond"; 10 - rev = "2d3f553060291f1bfee2e49fc2ca4a768b289df8"; 11 - sha256 = "0dpmwspll9ar3pxg9rgnh224934par8h8bixdz9i2pqqbc3dqib7"; 12 }; 13 14 nativeBuildInputs = [ cmake pkg-config ]; ··· 25 26 substituteInPlace $out/etc/systemd/system/joycond.service --replace \ 27 "ExecStart=/usr/bin/joycond" "ExecStart=$out/bin/joycond" 28 ''; 29 30 meta = with lib; {
··· 1 + { lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev, acl }: 2 3 stdenv.mkDerivation rec { 4 pname = "joycond"; 5 + version = "unstable-2021-07-30"; 6 7 src = fetchFromGitHub { 8 owner = "DanielOgorchock"; 9 repo = "joycond"; 10 + rev = "f9a66914622514c13997c2bf7ec20fa98e9dfc1d"; 11 + sha256 = "sha256-quw7yBHDDZk1+6uHthsfMCej7g5uP0nIAqzvI6436B8="; 12 }; 13 14 nativeBuildInputs = [ cmake pkg-config ]; ··· 25 26 substituteInPlace $out/etc/systemd/system/joycond.service --replace \ 27 "ExecStart=/usr/bin/joycond" "ExecStart=$out/bin/joycond" 28 + 29 + substituteInPlace $out/etc/udev/rules.d/89-joycond.rules --replace \ 30 + "/bin/setfacl" "${acl}/bin/setfacl" 31 ''; 32 33 meta = with lib; {