{ config, lib, pkgs, ... }: { options.services.fingerprint-fix.enable = lib.mkEnableOption "Enable systemd service to restart fingerprint services after suspend."; options.services.fingerprint-fix.calibDataFile = lib.mkOption { description = "Path to calibration data file."; }; config = lib.mkIf config.services.fingerprint-fix.enable { systemd.services.validity-restart = let targets = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; in { description = "Restart services to fix fingerprint integration"; wantedBy = targets; after = targets; serviceConfig = { type = "oneshot"; ExecStart = "systemctl restart python3-validity.service"; }; }; services."06cb-009a-fingerprint-sensor" = { enable = true; backend = "python-validity"; calib-data-file = config.services.fingerprint-fix.calibDataFile; }; services.open-fprintd.enable = lib.mkForce true; # Fprintd is not working with P51s systemd.services.open-fprintd-resume.enable = true; }; }