diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 83ec8b2de680f..d78d4fe2e5db9 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -14,6 +14,8 @@ - [Kimai](https://www.kimai.org/), a web-based multi-user time-tracking application. Available as [services.kimai](option.html#opt-services.kimai). +- [Framework Inputmodule](https://github.com/FrameworkComputer/inputmodule-rs), a tool to control Framework 16 input modules such as the LED Matrix. Available as [hardware.framework.inputmodule.enable](options.html#opt-hardware.framework.inputmodule.enable). + - [Omnom](https://github.com/asciimoo/omnom), a webpage bookmarking and snapshotting service. Available as [services.omnom](options.html#opt-services.omnom.enable). - [Amazon CloudWatch Agent](https://github.com/aws/amazon-cloudwatch-agent), the official telemetry collector for AWS CloudWatch and AWS X-Ray. Available as [services.amazon-cloudwatch-agent](#opt-services.amazon-cloudwatch-agent.enable). diff --git a/nixos/modules/hardware/framework.nix b/nixos/modules/hardware/framework.nix new file mode 100644 index 0000000000000..571374f51cac5 --- /dev/null +++ b/nixos/modules/hardware/framework.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options.hardware.framework = { + inputmodule.enable = lib.mkEnableOption "control software for the Framework 16 input modules"; + }; + + config = lib.mkIf config.hardware.framework.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 1d6f11953e469..9b58600b4fffe 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -65,6 +65,8 @@ ./hardware/digitalbitbox.nix ./hardware/flipperzero.nix ./hardware/flirc.nix + ./hardware/framework.nix + ./hardware/gkraken.nix ./hardware/glasgow.nix ./hardware/gpgsmartcards.nix ./hardware/graphics.nix diff --git a/pkgs/by-name/in/inputmodule-control/package.nix b/pkgs/by-name/in/inputmodule-control/package.nix new file mode 100644 index 0000000000000..32e61a9badd29 --- /dev/null +++ b/pkgs/by-name/in/inputmodule-control/package.nix @@ -0,0 +1,39 @@ +{ + lib, + fetchFromGitHub, + pkg-config, + rustPlatform, + systemd, +}: +rustPlatform.buildRustPackage rec { + pname = "inputmodule-control"; + version = "0.2.0-unstable-2024-11-17"; + + src = fetchFromGitHub { + owner = "FrameworkComputer"; + repo = "inputmodule-rs"; + rev = "262edffd35ad6aa7976aee38632f6b75695bc0a8"; + hash = "sha256-d9Tvxch9VZbaWzwe69oQMqlCRcirkrtoFJd2SaXh+wY="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-iqB0JxRlIwdjTh+dPa3W5bwYVOFGWObmBXUETZC6Rk8="; + buildAndTestSubdir = "inputmodule-control"; + + buildInputs = [ systemd ]; + nativeBuildInputs = [ pkg-config ]; + + postInstall = '' + mkdir -p $out/lib/udev/rules.d + cp release/50-framework-inputmodule.rules $out/lib/udev/rules.d/50-framework-inputmodule.rules + ''; + + meta = with lib; { + description = "Framework Laptop 16 Input Module"; + homepage = "https://github.com/FrameworkComputer/inputmodule-rs"; + license = licenses.mit; + maintainers = with maintainers; [ dsluijk ]; + mainProgram = "inputmodule-control"; + platforms = platforms.linux; + }; +}