1{ config, lib, ... }:
2{
3
4 ####### interface
5
6 options = {
7
8 hardware.onlykey = {
9 enable = lib.mkOption {
10 type = lib.types.bool;
11 default = false;
12 description = ''
13 Enable OnlyKey device (https://crp.to/p/) support.
14 '';
15 };
16 };
17
18 };
19
20 ## As per OnlyKey's documentation piece (hhttps://docs.google.com/document/d/1Go_Rs218fKUx-j_JKhddbSVTqY6P0vQO831t2MKCJC8),
21 ## it is important to add udev rule for OnlyKey for it to work on Linux
22
23 ####### implementation
24
25 config = lib.mkIf config.hardware.onlykey.enable {
26 services.udev.extraRules = builtins.readFile ./onlykey.udev;
27 };
28
29}