From 64f737ee3df5fae0d89aa5800ec5719162bc6b03 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Fri, 21 Jun 2024 10:42:56 +0200 Subject: [PATCH] feat: adds yubikey u2f auth --- modules/home/yubikey.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/home/yubikey.nix diff --git a/modules/home/yubikey.nix b/modules/home/yubikey.nix new file mode 100644 index 0000000..8908c68 --- /dev/null +++ b/modules/home/yubikey.nix @@ -0,0 +1,25 @@ +{ 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; + cue = true; + control = "sufficient"; + }; + + services = { + login.u2fAuth = true; + greetd.u2fAuth = true; + sudo.u2fAuth = true; + hyprlock.u2fAuth = true; + }; + }; + + environment.systemPackages = with pkgs; [ + yubikey-manager + ]; +}