From 80756cb5cf1717f7ab2237ac1c05b883e8122c48 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Tue, 7 Apr 2026 17:24:19 +0200 Subject: [PATCH] Setup CCID driver bundle directory and add ccid to udev packages --- nixos/modules/yubikey.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/yubikey.nix b/nixos/modules/yubikey.nix index 68e3918..e79a612 100644 --- a/nixos/modules/yubikey.nix +++ b/nixos/modules/yubikey.nix @@ -11,10 +11,18 @@ services.udev.packages = with pkgs; [ yubikey-personalization libu2f-host + ccid ]; # CCID driver for smartcard access (required for YubiKey CCID functionality) - services.pcscd.plugins = [ pkgs.ccid ]; + # Set up the PC/SC drivers directory with CCID driver bundle + system.activationScripts.pcscdSetup = '' + mkdir -p /var/lib/pcsc/drivers/ccid.bundle + # Try to symlink CCID bundle files if they exist + if [ -d "${pkgs.ccid}/lib/pcsc/drivers/ccid.bundle" ]; then + ln -sf "${pkgs.ccid}/lib/pcsc/drivers/ccid.bundle"/* /var/lib/pcsc/drivers/ccid.bundle/ 2>/dev/null || true + fi + ''; # YubiKey management tools environment.systemPackages = with pkgs; [