From 9eac410097bf484e17c239f562ee75e75385f0ad Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Wed, 19 Feb 2025 21:53:08 +0100 Subject: [PATCH] nixos/libftdi: Init module By enabling this module, the ftdi system group is created and udev rules from the libftdi package are enabled. Read-/Write access is granted to the members of the ftdi group and to seat sessions. Signed-off-by: Felix Singer --- nixos/modules/hardware/libftdi.nix | 23 +++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 24 insertions(+) create mode 100644 nixos/modules/hardware/libftdi.nix diff --git a/nixos/modules/hardware/libftdi.nix b/nixos/modules/hardware/libftdi.nix new file mode 100644 index 000000000000..b79e2ff8c257 --- /dev/null +++ b/nixos/modules/hardware/libftdi.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.hardware.libftdi; +in +{ + options.hardware.libftdi = { + enable = lib.mkEnableOption "udev rules for devices supported by libftdi"; + package = lib.mkPackageOption pkgs "libftdi1" { }; + }; + + config = lib.mkIf cfg.enable { + users.groups.ftdi = { }; + 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 a09388b9058a..d8dee392d89b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -78,6 +78,7 @@ ./hardware/keyboard/zsa.nix ./hardware/ksm.nix ./hardware/ledger.nix + ./hardware/libftdi.nix ./hardware/logitech.nix ./hardware/mcelog.nix ./hardware/network/ath-user-regd.nix