Compare commits

..

18 Commits

Author SHA1 Message Date
4388cc6249 Fix deprecated zsh option: initExtra -> initContent 2026-04-07 17:58:25 +02:00
bf211a91ef Fix renamed gpg-agent option: pinentryPackage -> pinentry.package 2026-04-07 17:55:48 +02:00
07d6dfa472 Add pinentry-curses to gpg-agent for YubiKey PIN prompts 2026-04-07 17:54:39 +02:00
8ad339bd89 Clean up yubikey.nix: remove redundant udev rule and improve comments 2026-04-07 17:47:17 +02:00
91b97f3720 Add udev rule to make YubiKey CCID interface accessible to pcscd 2026-04-07 17:37:50 +02:00
35a3908476 Remove broken reader.conf configuration - focus on fixing USB device permissions 2026-04-07 17:37:41 +02:00
8b2e483e6d Add explicit pcscd reader.conf configuration for CCID driver 2026-04-07 17:34:26 +02:00
952d27ae4c Fix CCID bundle setup: symlink entire bundle directory instead of contents 2026-04-07 17:31:14 +02:00
a31d2a9465 Fix CCID driver path: use ifd-ccid.bundle and correct pcsc directory location 2026-04-07 17:28:19 +02:00
fae75df867 Remove ccid from udev.packages - handle CCID setup via activation script only 2026-04-07 17:26:12 +02:00
0639afdb50 Remove pcsc_lite package (incorrect name) - focus on CCID driver directory setup 2026-04-07 17:25:23 +02:00
80756cb5cf Setup CCID driver bundle directory and add ccid to udev packages 2026-04-07 17:24:19 +02:00
cc382af4b4 Fix: use pcsc_lite (underscore) instead of pcsc-lite (hyphen) 2026-04-07 17:22:20 +02:00
89b46a6fc3 Add pcsc-lite to system packages for pcsc_scan tool 2026-04-07 17:21:23 +02:00
d9cc001552 Fix: use ccid package instead of libccid for pcscd CCID driver 2026-04-07 17:19:26 +02:00
44c2f98280 Add libccid CCID driver plugin to pcscd for YubiKey smartcard access 2026-04-07 17:18:53 +02:00
0d6013b605 Add usbutils to system packages for lsusb command 2026-04-07 17:16:46 +02:00
bc1691d01c adding yubikey func 2026-04-07 17:08:12 +02:00
5 changed files with 42 additions and 2 deletions

View File

@@ -66,6 +66,7 @@
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
pinentry.package = pkgs.pinentry-curses; # terminal PIN prompt for YubiKey
}; };
# Allow unfree packages # Allow unfree packages

View File

@@ -14,7 +14,7 @@
save = 10000; save = 10000;
}; };
initExtra = '' initContent = ''
bindkey '^R' history-incremental-search-backward bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward bindkey '^S' history-incremental-search-forward

View File

@@ -5,6 +5,7 @@
./modules/system.nix ./modules/system.nix
./modules/development.nix ./modules/development.nix
./modules/shell.nix ./modules/shell.nix
./modules/yubikey.nix
]; ];
# ============================================ # ============================================
@@ -17,6 +18,8 @@
curl curl
vim vim
htop htop
home-manager
usbutils
]; ];
# Allow unfree packages # Allow unfree packages

View File

@@ -12,7 +12,7 @@
# Users # Users
users.users.eliaskohout = { users.users.eliaskohout = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; extraGroups = [ "wheel" "docker" "plugdev" ];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };

36
nixos/modules/yubikey.nix Normal file
View File

@@ -0,0 +1,36 @@
{ pkgs, ... }:
{
# Create the plugdev group (required for user-space USB access to YubiKey)
users.groups.plugdev = {};
# Enable PC/SC daemon — required for GPG smartcard (gpg --card-status) and YubiKey
services.pcscd.enable = true;
# udev rules so the YubiKey gets plugdev group ownership and correct permissions
services.udev.packages = with pkgs; [
yubikey-personalization
libu2f-host
];
# Give pcscd access to the YubiKey CCID USB interface (interface 1 on FIDO+CCID devices)
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0406", MODE="0666"
'';
# CCID driver for smartcard access
# NixOS's services.pcscd.plugins does not populate /var/lib/pcsc/drivers,
# so we symlink the ifd-ccid.bundle from the ccid package directly.
system.activationScripts.pcscdSetup = ''
mkdir -p /var/lib/pcsc/drivers
rm -rf /var/lib/pcsc/drivers/ifd-ccid.bundle 2>/dev/null || true
ln -sf "${pkgs.ccid}/pcsc/drivers/ifd-ccid.bundle" /var/lib/pcsc/drivers/ifd-ccid.bundle
'';
# YubiKey management tools
environment.systemPackages = with pkgs; [
yubikey-manager # ykman CLI
yubikey-personalization # ykpers / ykchalresp
yubico-piv-tool # PIV applet management
];
}