From 2a97c0d985791d4d3edce9d8432db983a6905203 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 15 Feb 2023 11:33:56 +0800 Subject: [PATCH] nixos/hardware: add support for qmk keyboards --- nixos/modules/hardware/keyboard/qmk.nix | 16 ++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 17 insertions(+) create mode 100644 nixos/modules/hardware/keyboard/qmk.nix diff --git a/nixos/modules/hardware/keyboard/qmk.nix b/nixos/modules/hardware/keyboard/qmk.nix new file mode 100644 index 00000000000..df3bcaeccd2 --- /dev/null +++ b/nixos/modules/hardware/keyboard/qmk.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.hardware.keyboard.qmk; + inherit (lib) mdDoc mkEnableOption mkIf; + +in +{ + options.hardware.keyboard.qmk = { + enable = mkEnableOption (mdDoc "non-root access to the firmware of QMK keyboards"); + }; + + config = mkIf cfg.enable { + services.udev.packages = [ pkgs.qmk-udev-rules ]; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 74651efc0c5..cc8d7839fd0 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -58,6 +58,7 @@ ./hardware/gpgsmartcards.nix ./hardware/hackrf.nix ./hardware/i2c.nix + ./hardware/keyboard/qmk.nix ./hardware/keyboard/teck.nix ./hardware/keyboard/uhk.nix ./hardware/keyboard/zsa.nix