How to use fingerprint unlocking - How to set up Fprintd (English)

Hello, Recently I went into the “world” NixOS, and at first I had difficulties to be able to use screen unlock ing with the fingerprint sensor of my notebook, after much difficulty and the union of several solutions, I came to the following result that I come to share with you.

At first we need to install the fprintd package as follows;

Nix-env:

On NixOS:

nix-env -iA nixos.fprintd

On Non NixOS:

nix-env -iA nixpkgs.fprintd

NixOS Configuration:

environment.systemPackages = [

pkgs.fprintd

];

With this we must configure the following lines in NixOS Configuration;

services.fprintd.enable = true;

services.fprintd.tod.enable = true;

services.fprintd.tod.driver = pkgs.libfprint-2-tod1-vfs0090; (If the vfs0090 Driver does not work, use the following driver)

services.fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix; (On my device it only worked with this driver)

Finally, we must rotate one:

sudo nixos-rebuild switch

When you restart the system, the fingerprint option will appear in the user password menu, so it can be configured.

3 Likes

I strongly suspect there’s no point in installing fprintd with nix-env, as all that really does is get the command into PATH, which doesn’t actually help with unlocking your screen.

Furthermore, the NixOS module for it automatically adds it to environment.systemPackages, so there’s no need to do that either.

Also, the text in parentheses in the quoted configuration snippet would cause parse errors if pasted directly. It seems like you meant only one of the tod.driver lines to be included, but didn’t translate the text describing the conditions.

The directions can be boiled down to something like this:

Add this to your configuration.nix if (whatever that means in the first parentheses)

services.fprintd.enable = true;
services.fprintd.tod.enable = true;
services.fprintd.tod.driver = pkgs.libfprint-2-tod1-vfs0090;

Add this to your configuration.nix if (whatever that means in the second parentheses)

services.fprintd.enable = true;
services.fprintd.tod.enable = true;
services.fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix;

(To be clear, I still don’t know if these directions actually work, as I haven’t tested them and don’t have the hardware to do so.)

5 Likes

Thanks for the considerations, I performed the translation of the parentheses, I’m new with the nixOS distribution, I hope my post helps others who can test.

1 Like

How do I configure the fingerprint reader exactly.
You were mentioning the user password menu. Where is that?
(I am using lightdm + xfce.)

I just used fprintd-enroll to setup my fingerprints if that’s what you are after.

1 Like

I had such a bad experience with the fingerprint setup that I disabled it after a couple days.
It works, it uses the fingerprint and unlocks the screen, or even sudo in the terminal, which is super convinient.
The problem is when your laptop is closed and you’re using a screen. It literally didn’t allow me to type the password in the gdm/login screen. In the terminal is a bit inconvinent, you need to crlt+c the fingerprint prompt, but at least then you have an option.

Maybe I was unlucky, but it wasn’t for me!

1 Like

@tscolari – How exactly did you get the actual fingerprint reader to unlock the screen, work with sudo, etc. I followed these steps, and any other references I can find, and I can only enroll fingers using sudo, which defeats the purpose, and every other time I get errors about either no devices found, or not authorized to enroll fingerprints. Pullin my hair out over here…!

Because:

$ sudo lsusb -v|rg Fingerprint
969:Bus 003 Device 002: ID 27c6:5125 Shenzhen Goodix Technology Co.,Ltd. Goodix Fingerprint Device
982:  iProduct                2 Goodix Fingerprint Device

So I

  services.fprintd.enable = true;
  services.fprintd.tod.enable = true;
  services.fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix;

However, it cannot work.

$ fprintd-enroll wzy
Impossible to enroll: GDBus.Error:net.reactivated.Fprint.Error.NoSuchDevice: No devices available

Hey sorry, I didn’t see your reply before!
I literally followed the steps above, on my dell laptop I had to use one driver, on lenovo the other one - but if you can enroll fingerprints I think you got the correct one already.
Everything else just worked out of the box from that point. I’m using gnome.
Some people pointed out that it needs to be enabled in the gnome / profile GUI configuration, but I had no such option there.

I’m on a surface laptop and not able to get this working.

I’m not seeing any interface settings and when I try to manually enroll I got the same error as Freed-Wu.

Impossible to enroll: GDBus.Error:net.reactivated.Fprint.Error.NoSuchDevice: No devices available

Do I need a different driver? I tried both of the ones listed above.

Have you tried sudo fprintd-enroll?

It has been a bit since I enrolled mine, but I do recall one step the surprised me by requiring elevated permissions. I think it was the enroll step.

Unfortunately, no luck with that. Still gave the same error, which points to a driver issue.

I have a Microsoft Surface Laptop Go 2 w/ fingerprint scanner of course. :wink:

Is maybe the surface finger print hardware not supported for Linux in general?
Looks like you might need some custom kernel according to Reddit https://www.reddit.com/r/SurfaceLinux/comments/rkfctj/surface_laptop_go_fingerprint_support/

Thanks tscolari, I did find that in my research. I’m guessing there should also be some code added to the hardware configuration if it’s not being recognized?

Is it possible to just run two different kernels or running a primary with a spliced in custom code? I’m not exactly sure how kernels work, but I thought it was one at a time.

I see in the wiki it seems to be possible to run custom kernel, but I’m likely to screw that up as I’m new to that part of Linux.

Can running a custom kernel or add-on kernel be as easy as adding a few lines to the config?

Just to add my experience. My system: NixOS 24.05.20240228.9099616 (Uakari); Laptop Thinkpad X1 gen 9. I run Flake and home-manager. In addition to adding fprintd package I added this to my configuration.nix:

services.fprintd = {
  enable = true;
  package = pkgs.fprintd-tod;
  tod = {
    enable = true;
    driver = pkgs.libfprint-2-tod1-vfs0090;
  };
};

Next I ran fprintd-enroll and it asked for password. After that it just worked for sudo and for gdm.

1 Like

For me, services.fprintd.enable was enough. I didn’t need to use tod at all.

I used kde’s UI to enroll fingerprints, it worked like a charm as well.