adding yubikey func

This commit is contained in:
2026-04-07 17:08:12 +02:00
parent 237939b0e8
commit bc1691d01c
3 changed files with 25 additions and 1 deletions

View File

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

View File

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

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

@@ -0,0 +1,22 @@
{ 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
];
# YubiKey management tools
environment.systemPackages = with pkgs; [
yubikey-manager # ykman CLI
yubikey-personalization # ykpers / ykchalresp
yubico-piv-tool # PIV applet management
];
}