summaryrefslogtreecommitdiffstats
path: root/nixos/modules/programs/ergohaven-entropy.nix
blob: 45cd9026f5369816adb4d702b7bf18689c9d0cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.programs.entropy;
  inherit (lib) mkIf;
in
{
  options.programs.entropy = {
    enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Enables the Entropy keyboard configurator and sets up necessary
        udev rules for Vial-QMK/RMK compatible devices.
        This allows configuring programmable keyboards without root privileges.
        Ensure your user is a member of the 'plugdev' group after enabling.
      '';
    };
  };

  config = mkIf cfg.enable {
    users.groups.plugdev = { };

    environment.systemPackages = [ pkgs.ergohaven-entropy ];

    services.udev.packages = [ pkgs.ergohaven-entropy ];

    i18n.inputMethod.ibus.engines = [ pkgs.ergohaven-entropy ];
  };
}