don't lock when yubikey is unplugged

This commit is contained in:
jacekpoz 2024-06-09 16:02:05 +02:00
parent ee12047750
commit dcf3d5dc57
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -1,20 +1,8 @@
{
pkgs,
...
}: {
_: {
security.pam = {
services = {
login.u2fAuth = true;
sudo.u2fAuth = true;
};
};
services.udev.extraRules = ''
ACTION=="remove",\
ENV{ID_BUS}=="usb",\
ENV{ID_MODEL_ID}=="0407",\
ENV{ID_VENDOR_ID}=="1050",\
ENV{ID_VENDOR}=="Yubico",\
RUN+="${pkgs.systemd}/bin/loginctl lock-sessions"
'';
}