1 minute read

Introduction

If you’re running NixOs on your laptop, and your laptop have fingrerprint scanner, it can be very convenient to use it for authentication. I couldn’t find any articles on setting up fprintd on NixOS, so I’ll share how I’ve done it.

I am using regreet for my login manager, and, while it don’t have any documentation about supporting fingerprint login, it worked flawlessly for me without any additional configuration.

For my lock screen swaylock it is supported.

Installing fprintd

First, we need to install and enable fprintd:

 services.fprintd.enable = true;

 security.pam.services.swaylock = {};
 security.pam.services.swaylock.fprintAuth = true;

Enrolling Fingerprints

Once fprintd is installed, we need to enroll our fingerprints. This registers your fingerprints with the service so it can recognize them later for authentication.

Run the fprintd-enroll command to start the interactive enrollment process(I had to use root user to add fingerprints):

$ sudo fprintd-enroll <user>

You will be prompted to scan your fingers until the enrollment process is complete.

To verify your fingerprint, run

$ fprintd-verify

I didn’t mess with PAM or anything else to get this working.

Logging In with a Fingerprint

To configure fingerprint for login manager, check out corresponding documentation. For example, SDDM

As I already mentioned, ReGreet worked without any additional configuraiton. PXL_20231019_071308433 MP

To unlocking Laptop with SwayLock, just place your finger on the scanner.

Conclusion

To me, the process was really simple. Check out the Fprint for more information.

Comments