mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 02:03:01 +00:00
0a37316d6c
This commit replaces a lot of usages of `mkOption` with the package type, to be `mkPackageOption`, in order to reduce the amount of code.
27 lines
570 B
Nix
27 lines
570 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.services.joycond;
|
|
in
|
|
|
|
with lib;
|
|
|
|
{
|
|
options.services.joycond = {
|
|
enable = mkEnableOption (lib.mdDoc "support for Nintendo Pro Controllers and Joycons");
|
|
|
|
package = mkPackageOption pkgs "joycond" { };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
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" ];
|
|
};
|
|
}
|