forked from mirrors/nixpkgs
nixos/fprintd: add TOD support
Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Signed-off-by: Yurii Matsiuk <ymatsiuk@users.noreply.github.com>
This commit is contained in:
parent
531502481b
commit
b29ed56049
|
@ -5,6 +5,7 @@ with lib;
|
|||
let
|
||||
|
||||
cfg = config.services.fprintd;
|
||||
fprintdPkg = if cfg.tod.enable then pkgs.fprintd-tod else pkgs.fprintd;
|
||||
|
||||
in
|
||||
|
||||
|
@ -17,25 +18,30 @@ in
|
|||
|
||||
services.fprintd = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable fprintd daemon and PAM module for fingerprint readers handling.
|
||||
'';
|
||||
};
|
||||
enable = mkEnableOption "fprintd daemon and PAM module for fingerprint readers handling";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.fprintd;
|
||||
defaultText = "pkgs.fprintd";
|
||||
default = fprintdPkg;
|
||||
defaultText = "if cfg.tod.enable then pkgs.fprintd-tod else pkgs.fprintd";
|
||||
description = ''
|
||||
fprintd package to use.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
tod = {
|
||||
|
||||
enable = mkEnableOption "Touch OEM Drivers library support";
|
||||
|
||||
driver = mkOption {
|
||||
type = types.package;
|
||||
example = literalExample "pkgs.libfprint-2-tod1-goodix";
|
||||
description = ''
|
||||
Touch OEM Drivers (TOD) package to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -49,6 +55,10 @@ in
|
|||
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
systemd.services.fprintd.environment = mkIf cfg.tod.enable {
|
||||
FP_TOD_DRIVERS_DIR = "${cfg.tod.driver}${cfg.tod.driver.driverPath}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ stdenv.mkDerivation {
|
|||
cp lib/udev/rules.d/60-libfprint-2-tod1-goodix.rules "$out/usr/lib/udev/rules.d/"
|
||||
'';
|
||||
|
||||
passthru.driverPath = "/usr/lib/libfprint-2/tod-1";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Goodix driver module for libfprint-2-tod Touch OEM Driver";
|
||||
homepage = "https://git.launchpad.net/~oem-solutions-engineers/libfprint-2-tod1-goodix/+git/libfprint-2-tod1-goodix/";
|
||||
|
|
Loading…
Reference in a new issue