Merge pull request #117928 from ymatsiuk/fprintd-tod

nixos/fprintd: add TOD support
This commit is contained in:
Graham Christensen
2021-04-15 11:51:09 -04:00
committed by GitHub
2 changed files with 27 additions and 15 deletions
+20 -10
View File
@@ -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}";
};
};
}