diff --git a/deploy/nixos/hardware/upboard.nix b/deploy/nixos/hardware/upboard.nix index d213ff7..499179e 100644 --- a/deploy/nixos/hardware/upboard.nix +++ b/deploy/nixos/hardware/upboard.nix @@ -91,6 +91,27 @@ cpuFreqGovernor = "performance"; }; + # PC/SC daemon for the HID Global OMNIKEY 5022 contactless reader + # (076b:5022, a CCID smart-card reader) used for Bolt Card tap-to-enter + # (ADR-003). pcscd binds the CCID driver; the app talks to pcscd's socket + # (via nfc-pcsc) rather than the USB device directly. Device-agnostic — + # same wiring as batm3's Feitian KP382; harmless if no reader is attached, + # pcscd just idles. Shared by every upboard machine (sintra, tejo). + services.pcscd.enable = true; + + # pcscd gates client access via polkit; without a rule the sandboxed + # `bitspire` service user is "Rejected unauthorized PC/SC client". Authorize + # it to talk to the daemon and the card. + security.polkit.extraConfig = '' + polkit.addRule(function(action, subject) { + if ((action.id == "org.debian.pcsc-lite.access_pcsc" || + action.id == "org.debian.pcsc-lite.access_card") && + subject.user == "bitspire") { + return polkit.Result.YES; + } + }); + ''; + # Disable suspend/hibernate for kiosk systemd.targets = { sleep.enable = false;