add yubikey u2f auth :3
This commit is contained in:
parent
ee11e03961
commit
ee12047750
3 changed files with 22 additions and 0 deletions
|
@ -27,5 +27,6 @@ _: {
|
|||
../../options/desktop/waydroid.nix
|
||||
../../options/desktop/wayland.nix
|
||||
../../options/desktop/wireshark.nix
|
||||
../../options/desktop/yubikey.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -29,5 +29,6 @@ _: {
|
|||
../../options/desktop/v4l2.nix
|
||||
../../options/desktop/waydroid.nix
|
||||
../../options/desktop/wayland.nix
|
||||
../../options/desktop/yubikey.nix
|
||||
];
|
||||
}
|
||||
|
|
20
options/desktop/yubikey.nix
Normal file
20
options/desktop/yubikey.nix
Normal 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"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue