2015-01-03 16:47:38 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.fprintd;
|
2021-03-29 10:27:51 +00:00
|
|
|
fprintdPkg = if cfg.tod.enable then pkgs.fprintd-tod else pkgs.fprintd;
|
2015-01-03 16:47:38 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.fprintd = {
|
|
|
|
|
2024-04-13 12:54:15 +00:00
|
|
|
enable = mkEnableOption "fprintd daemon and PAM module for fingerprint readers handling";
|
2015-01-03 16:47:38 +00:00
|
|
|
|
2019-05-15 20:56:58 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
2021-03-29 10:27:51 +00:00
|
|
|
default = fprintdPkg;
|
2021-10-03 16:06:03 +00:00
|
|
|
defaultText = literalExpression "if config.services.fprintd.tod.enable then pkgs.fprintd-tod else pkgs.fprintd";
|
2024-04-13 12:54:15 +00:00
|
|
|
description = ''
|
2019-05-15 20:56:58 +00:00
|
|
|
fprintd package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-03-29 10:27:51 +00:00
|
|
|
tod = {
|
|
|
|
|
2024-04-13 12:54:15 +00:00
|
|
|
enable = mkEnableOption "Touch OEM Drivers library support";
|
2019-04-14 14:19:57 +00:00
|
|
|
|
2021-03-29 10:27:51 +00:00
|
|
|
driver = mkOption {
|
|
|
|
type = types.package;
|
2021-10-03 16:06:03 +00:00
|
|
|
example = literalExpression "pkgs.libfprint-2-tod1-goodix";
|
2024-04-13 12:54:15 +00:00
|
|
|
description = ''
|
2021-03-29 10:27:51 +00:00
|
|
|
Touch OEM Drivers (TOD) package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-01-03 16:47:38 +00:00
|
|
|
};
|
2019-04-14 14:19:57 +00:00
|
|
|
|
|
|
|
|
2015-01-03 16:47:38 +00:00
|
|
|
###### implementation
|
2019-04-14 14:19:57 +00:00
|
|
|
|
2015-01-03 16:47:38 +00:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
2021-01-10 16:29:43 +00:00
|
|
|
services.dbus.packages = [ cfg.package ];
|
2015-01-03 16:47:38 +00:00
|
|
|
|
2021-01-10 16:29:43 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2015-01-03 16:47:38 +00:00
|
|
|
|
2019-05-15 20:56:58 +00:00
|
|
|
systemd.packages = [ cfg.package ];
|
2015-01-03 16:47:38 +00:00
|
|
|
|
2021-03-29 10:27:51 +00:00
|
|
|
systemd.services.fprintd.environment = mkIf cfg.tod.enable {
|
|
|
|
FP_TOD_DRIVERS_DIR = "${cfg.tod.driver}${cfg.tod.driver.driverPath}";
|
|
|
|
};
|
|
|
|
|
2015-01-03 16:47:38 +00:00
|
|
|
};
|
2019-04-14 14:19:57 +00:00
|
|
|
|
2015-01-03 16:47:38 +00:00
|
|
|
}
|