From b7741981ab853e461cd4cf469e715aa4cc2fc9ba Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 6 Jul 2025 16:29:09 -0600 Subject: sys/hardware: add support for Athena ASEDrive reader --- sys/hardware/athena.nix | 37 +++++++++++++++++++++++++++++++++++++ sys/hardware/default.nix | 1 + 2 files changed, 38 insertions(+) create mode 100644 sys/hardware/athena.nix (limited to 'sys/hardware') diff --git a/sys/hardware/athena.nix b/sys/hardware/athena.nix new file mode 100644 index 0000000..b9a230b --- /dev/null +++ b/sys/hardware/athena.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: +with lib; let + cfg = config.local.hardware.athena; + + athena = pkgs.local.athena-bccr.${cfg.release}; +in +{ + options.local.hardware.athena = { + enable = mkEnableOption "Athena ASEDrive III smartcard reader"; + + release = mkOption { + type = types.str; + default = "latest"; + description = "athena-bccr release tag"; + }; + }; + + config = mkIf cfg.enable { + environment.etc = { + "Athena".source = "${athena.ase-idprotect}/etc/Athena"; + + "pkcs11/modules/asep11".text = '' + module: ${athena.libasep11} + ''; + }; + + services = { + pcscd.enable = true; + + #TODO: SerĂ­a mejor agregar un grupo separado + udev.extraRules = '' + # Athena Smartcard Solutions, Inc. ASEDrive V3CR + ATTRS{idVendor}=="0dc3", ATTRS{idProduct}=="1004", MODE="660", GROUP="users", TAG+="uaccess" + ''; + }; + }; +} diff --git a/sys/hardware/default.nix b/sys/hardware/default.nix index 10bdece..2ded912 100644 --- a/sys/hardware/default.nix +++ b/sys/hardware/default.nix @@ -1,6 +1,7 @@ { imports = [ ./altera.nix + ./athena.nix ./apc.nix ./bluetooth.nix ./epson.nix -- cgit v1.2.3