From 4d8d5f5782be9f86847e47f87d50fca0763061fe Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Wed, 19 Feb 2025 21:53:08 +0100 Subject: [PATCH] nixos/libjaylink: init module By enabling this module, the jlink system group is created and udev rules from the libjaylink package are enabled. Read-/Write access is granted to the members of the jlink group and to seat sessions. Signed-off-by: Felix Singer --- nixos/modules/hardware/libjaylink.nix | 27 +++++++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 28 insertions(+) create mode 100644 nixos/modules/hardware/libjaylink.nix diff --git a/nixos/modules/hardware/libjaylink.nix b/nixos/modules/hardware/libjaylink.nix new file mode 100644 index 000000000000..0eb531e97926 --- /dev/null +++ b/nixos/modules/hardware/libjaylink.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.hardware.libjaylink; +in +{ + options.hardware.libjaylink = { + enable = lib.mkEnableOption '' + udev rules for devices supported by libjaylink. + Add users to the `jlink` group in order to grant + them access + ''; + package = lib.mkPackageOption pkgs "libjaylink" { }; + }; + + config = lib.mkIf cfg.enable { + users.groups.jlink = { }; + services.udev.packages = [ cfg.package ]; + }; + + meta.maintainers = with lib.maintainers; [ felixsinger ]; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 8b0f482e197c..719fce2f4e6c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -80,6 +80,7 @@ ./hardware/ksm.nix ./hardware/ledger.nix ./hardware/libftdi.nix + ./hardware/libjaylink.nix ./hardware/logitech.nix ./hardware/mcelog.nix ./hardware/network/ath-user-regd.nix