Skip to content

Commit

Permalink
nixos/fprintd: add elanmoc2 support
Browse files Browse the repository at this point in the history
Added services.fprintd.elanmoc2.enable that uses an overlay to add support for the ELAN 04f3:0c00 fingerprint sensor.
  • Loading branch information
sandptel authored Dec 9, 2024
1 parent c7035f6 commit 694be47
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions nixos/modules/services/security/fprintd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,30 @@
with lib;

let

cfg = config.services.fprintd;

fprintdPkg = if cfg.tod.enable then pkgs.fprintd-tod else pkgs.fprintd;

in
# Overlay to support elanmoc2 if enabled
myOverlay = final: prev: {
libfprint = prev.libfprint.overrideAttrs (old: {
src = builtins.fetchGit {
url = "https://gitlab.freedesktop.org/depau/libfprint.git";
ref = "elanmoc2";
rev = "f4439ce96b2938fea8d4f42223d7faea05bd4048";
};
});
fprintd = prev.fprintd.overrideAttrs (old: {
mesonCheckFlags = [
"--no-suite" "fprintd:TestPamFprintd"
"--no-suite" "fprintd:FPrintdManagerPreStartTests"
];
});
};

in

{

###### interface

options = {
Expand Down Expand Up @@ -41,13 +56,18 @@ in
'';
};
};

elanmoc2 = {

enable = mkEnableOption "Compile elanmoc2 to enable support for 04f3:0c00 fingerprint reader";

};
};
};


###### implementation

config = mkIf cfg.enable {
config = mkIf (cfg.enable || cfg.elanmoc2.enable) {

services.dbus.packages = [ cfg.package ];

Expand All @@ -59,6 +79,8 @@ in
FP_TOD_DRIVERS_DIR = "${cfg.tod.driver}${cfg.tod.driver.driverPath}";
};

};
# Apply overlay if elanmoc2 is enabled
nixpkgs.overlays = mkIf cfg.elanmoc2.enable [ myOverlay ];

};
}

0 comments on commit 694be47

Please sign in to comment.