nix-conf/system/yubikey.nix
2026-03-08 16:53:11 -05:00

35 lines
774 B
Nix

{
config,
lib,
pkgs,
...
}:
lib.mkIf config.u.has.yubikey {
environment.systemPackages = [
pkgs.yubikey-manager
pkgs.yubioath-flutter
pkgs.pam_u2f
];
services.pcscd.enable = true;
services.udev.packages = [pkgs.yubikey-personalization];
services.yubikey-agent.enable = true;
security.pam = {
u2f = {
enable = true;
settings.cue = true;
};
services.login.u2fAuth = false;
services.physlock.u2fAuth = false;
};
programs.yubikey-touch-detector.enable = true;
systemd.services."polkit-agent-helper@".serviceConfig = {
PrivateDevices = lib.mkForce false;
DeviceAllow = [
"/dev/urandom r"
"char-hidraw rw"
];
ProtectHome = lib.mkForce "read-only";
StandardError = "journal";
};
}