nixos-config/modules/core/yubikey.nix

30 lines
782 B
Nix
Raw Normal View History

{ pkgs, inputs, config, username, host, ...}:
2024-06-21 20:43:12 +02:00
{
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-12-20 00:23:04 +01:00
swaylock.fprintAuth = if (host == "sakura") then true else false;
hyprlock.fprintAuth = if (host == "sakura") then true else false;
2024-06-21 20:43:12 +02:00
};
};
2024-12-20 00:23:04 +01:00
services.fprintd.enable = if (host == "sakura") then true else false;
2024-09-28 18:07:09 +02:00
2024-06-21 20:43:12 +02:00
environment.systemPackages = with pkgs; [
yubikey-manager
];
}