diff --git a/nixos/modules/services/security/fprintd.nix b/nixos/modules/services/security/fprintd.nix index 87c3f1f6f9e42..c81ededf84726 100644 --- a/nixos/modules/services/security/fprintd.nix +++ b/nixos/modules/services/security/fprintd.nix @@ -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 = { @@ -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 ]; @@ -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 ]; + }; }