Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/fprintd: add elanmoc2 support #363609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ];

};
}
Loading