1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 04:02:10 +00:00
nixpkgs/nixos/modules/services/hardware/joycond.nix
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00

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" ];
};
}