32 lines
1.1 KiB
Nix
32 lines
1.1 KiB
Nix
{ 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 {
|
|
# Needed because we're getting TLS error with open-fprintd-resume
|
|
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.fprintd.enable = lib.mkForce true; # Fprintd is not working with P51s
|
|
};
|
|
}
|