summary refs log tree commit diff
path: root/nixos/modules/hardware/uinput.nix
blob: 55e86bfa6bdbfe23a306e5a657b729476358acae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ config, pkgs, lib, ... }:

let
  cfg = config.hardware.uinput;
in {
  options.hardware.uinput = {
    enable = lib.mkEnableOption "uinput support";
  };

  config = lib.mkIf cfg.enable {
    boot.kernelModules = [ "uinput" ];

    users.groups.uinput = {};

    services.udev.extraRules = ''
      SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
    '';
  };
}