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.
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)
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.
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.
@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…!
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.
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: