1 { config, lib, pkgs, ... }:
4 cfg = config.services.joycond;
5 kernelPackages = config.boot.kernelPackages;
11 options.services.joycond = {
12 enable = mkEnableOption (lib.mdDoc "support for Nintendo Pro Controllers and Joycons");
16 default = pkgs.joycond;
17 defaultText = "pkgs.joycond";
18 description = lib.mdDoc ''
19 The joycond package to use.
24 config = mkIf cfg.enable {
25 environment.systemPackages = [ cfg.package ];
27 boot.extraModulePackages = optional (versionOlder kernelPackages.kernel.version "5.16") kernelPackages.hid-nintendo;
29 services.udev.packages = [ cfg.package ];
31 systemd.packages = [ cfg.package ];
33 # Workaround for https://github.com/NixOS/nixpkgs/issues/81138
34 systemd.services.joycond.wantedBy = [ "multi-user.target" ];