From 7ded89c030c77184d5fc2d4400153a4902dbeab1 Mon Sep 17 00:00:00 2001 From: Torben Schweren Date: Sat, 27 Apr 2024 21:04:57 +0200 Subject: [PATCH] nixos/inputmodule: init module --- nixos/doc/manual/release-notes/rl-2405.section.md | 2 ++ nixos/modules/hardware/inputmodule.nix | 13 +++++++++++++ nixos/modules/module-list.nix | 1 + pkgs/by-name/in/inputmodule-control/package.nix | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/hardware/inputmodule.nix diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 17df5d71f9724a1..ee71035e98ed1ca 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -641,3 +641,5 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m This enables mandoc to find manual pages in Nix profiles. To set the manual search paths via the `mandoc.conf` configuration file like before, use `documentation.man.mandoc.settings.manpath` instead. - `grafana-loki` package was updated to 3.0.0 which includes [breaking changes](https://github.com/grafana/loki/releases/tag/v3.0.0) + +- Framework input modules, like the LED matrix, are now supported by enabling the `hardware.inputmodule.enable` option. This module installs the `inputmodule-control` CLI tool and adds udev rules for user access. diff --git a/nixos/modules/hardware/inputmodule.nix b/nixos/modules/hardware/inputmodule.nix new file mode 100644 index 000000000000000..016feb5c7d4207b --- /dev/null +++ b/nixos/modules/hardware/inputmodule.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ + options.hardware.inputmodule.enable = mkEnableOption '' + Enable support for Framework input modules + ''; + + config = mkIf config.hardware.inputmodule.enable { + environment.systemPackages = [ pkgs.inputmodule-control ]; + services.udev.packages = [ pkgs.inputmodule-control ]; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 50157f62ed32042..6633f0372377dc8 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -69,6 +69,7 @@ ./hardware/hackrf.nix ./hardware/i2c.nix ./hardware/infiniband.nix + ./hardware/inputmodule.nix ./hardware/keyboard/qmk.nix ./hardware/keyboard/teck.nix ./hardware/keyboard/uhk.nix diff --git a/pkgs/by-name/in/inputmodule-control/package.nix b/pkgs/by-name/in/inputmodule-control/package.nix index f59847fb75d1447..3a11e882f28628f 100644 --- a/pkgs/by-name/in/inputmodule-control/package.nix +++ b/pkgs/by-name/in/inputmodule-control/package.nix @@ -48,4 +48,4 @@ in changelog = "https://github.com/FrameworkComputer/inputmodule-rs/releases/tag/v${ver}"; maintainers = with maintainers; [ Kitt3120 ]; }; - } \ No newline at end of file + }