Merge pull request #139502 from Vodurden/nixos-unstable

Support virtual Nintendo Switch Pro controllers in joycond

Changed files
+58 -4
nixos
doc
manual
from_md
release-notes
release-notes
modules
services
hardware
pkgs
os-specific
linux
joycond
+8
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
···
<link linkend="opt-programs.pantheon-tweaks.enable">programs.pantheon-tweaks</link>.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-release-21.11-incompatibilities">
···
<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">
+2
nixos/doc/manual/release-notes/rl-2111.section.md
···
- [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).
## 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.
···
- [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.
+1
nixos/modules/module-list.nix
···
./services/hardware/illum.nix
./services/hardware/interception-tools.nix
./services/hardware/irqbalance.nix
./services/hardware/lcd.nix
./services/hardware/lirc.nix
./services/hardware/nvidia-optimus.nix
···
./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
···
···
+
{ 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" ];
+
};
+
}
+7 -4
pkgs/os-specific/linux/joycond/default.nix
···
-
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev }:
stdenv.mkDerivation rec {
pname = "joycond";
-
version = "unstable-2021-03-27";
src = fetchFromGitHub {
owner = "DanielOgorchock";
repo = "joycond";
-
rev = "2d3f553060291f1bfee2e49fc2ca4a768b289df8";
-
sha256 = "0dpmwspll9ar3pxg9rgnh224934par8h8bixdz9i2pqqbc3dqib7";
};
nativeBuildInputs = [ cmake pkg-config ];
···
substituteInPlace $out/etc/systemd/system/joycond.service --replace \
"ExecStart=/usr/bin/joycond" "ExecStart=$out/bin/joycond"
'';
meta = with lib; {
···
+
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevdev, udev, acl }:
stdenv.mkDerivation rec {
pname = "joycond";
+
version = "unstable-2021-07-30";
src = fetchFromGitHub {
owner = "DanielOgorchock";
repo = "joycond";
+
rev = "f9a66914622514c13997c2bf7ec20fa98e9dfc1d";
+
sha256 = "sha256-quw7yBHDDZk1+6uHthsfMCej7g5uP0nIAqzvI6436B8=";
};
nativeBuildInputs = [ cmake pkg-config ];
···
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; {