add yubikey u2f auth :3

This commit is contained in:
jacekpoz 2024-06-09 15:57:20 +02:00
parent ee11e03961
commit ee12047750
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 22 additions and 0 deletions

View file

@ -27,5 +27,6 @@ _: {
../../options/desktop/waydroid.nix
../../options/desktop/wayland.nix
../../options/desktop/wireshark.nix
../../options/desktop/yubikey.nix
];
}

View file

@ -29,5 +29,6 @@ _: {
../../options/desktop/v4l2.nix
../../options/desktop/waydroid.nix
../../options/desktop/wayland.nix
../../options/desktop/yubikey.nix
];
}

View file

@ -0,0 +1,20 @@
{
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"
'';
}