1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.hardware.keyboard.qmk;
10 inherit (lib) mkEnableOption mkIf;
11
12in
13{
14 options.hardware.keyboard.qmk = {
15 enable = mkEnableOption "non-root access to the firmware of QMK keyboards";
16 };
17
18 config = mkIf cfg.enable {
19 services.udev.packages = [ pkgs.qmk-udev-rules ];
20 users.groups.plugdev = { };
21 };
22}