2021-10-07 14:46:35 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.joycond;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.joycond = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkEnableOption "support for Nintendo Pro Controllers and Joycons";
|
2021-10-07 14:46:35 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
package = lib.mkPackageOption pkgs "joycond" { };
|
2021-10-07 14:46:35 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2022-03-30 09:31:56 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2021-10-07 14:46:35 +00:00
|
|
|
|
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
}
|