nixos-config/modules/core/yubikey.nix

33 lines
701 B
Nix
Raw Normal View History

2024-06-21 20:43:12 +02:00
{ pkgs, ...}:
{
services.udev.packages = [ pkgs.yubikey-personalization ];
# FIXME Don't forget to create an authorization mapping file for your user (https://nixos.wiki/wiki/Yubikey#pam_u2f)
security.pam = {
u2f = {
enable = true;
2024-07-22 11:16:41 +02:00
settings.cue = true;
2024-06-21 20:43:12 +02:00
control = "sufficient";
};
services = {
login.u2fAuth = true;
greetd.u2fAuth = true;
sudo.u2fAuth = true;
hyprlock.u2fAuth = true;
2024-09-28 18:07:09 +02:00
swaylock.fprintAuth = true;
hyprlock.fprintAuth = true;
# pam.services.swaylock = {}; # Already enabled
2024-06-21 20:43:12 +02:00
};
};
2024-09-28 18:07:09 +02:00
services = {
fprintd.enable = true;
};
2024-06-21 20:43:12 +02:00
environment.systemPackages = with pkgs; [
yubikey-manager
];
}