nixos-config/modules/core/yubikey.nix

55 lines
1 KiB
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 = {
2025-11-21 11:30:31 +01:00
pcscd.enable = true;
login.u2fAuth = false;
greetd.u2fAuth = false;
2024-06-21 20:43:12 +02:00
sudo.u2fAuth = true;
swaylock.fprintAuth =
if (host == "sakura") then
true
else if (host == "zinnia") then
true
else
false;
hyprlock.u2fAuth = false;
hyprlock.fprintAuth =
if (host == "sakura") then
true
else if (host == "zinnia") then
true
else
false;
2024-06-21 20:43:12 +02:00
};
};
services.fprintd.enable =
if (host == "sakura") then
true
else if (host == "zinnia") 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
];
}