about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-04-15 18:13:27 +0000
committerGitHub <noreply@github.com>2021-04-15 18:13:27 +0000
commitdfd4f1430301305a0c543f034a95aaae6e3ce09d (patch)
treee451a4f3f1defad8765a1bdcee54846f014741fd /nixos
parent80e725f3dc9daff0b720b4cb7d7088cdc65e015d (diff)
parentbc5c0c559f1c93ccea9a7f21066b6314831bea3d (diff)
downloadnixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar.gz
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar.bz2
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar.lz
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar.xz
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.tar.zst
nixlib-dfd4f1430301305a0c543f034a95aaae6e3ce09d.zip
Merge master into staging-next
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/security/fprintd.nix30
1 files changed, 20 insertions, 10 deletions
diff --git a/nixos/modules/services/security/fprintd.nix b/nixos/modules/services/security/fprintd.nix
index 48f8a9616c3e..fe0fba5b45d7 100644
--- a/nixos/modules/services/security/fprintd.nix
+++ b/nixos/modules/services/security/fprintd.nix
@@ -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}";
+    };
+
   };
 
 }