51 lines
1.3 KiB
Nix
51 lines
1.3 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
inputs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
options.modules.fingerprint-fix = {
|
|
enable = lib.mkEnableOption "Enable support for fingerprint for P51S-like ThinkPads.";
|
|
calibDataFile = lib.mkOption {
|
|
description = "Path to calibration data file.";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
inputs.fingerprint-sensor.nixosModules."06cb-009a-fingerprint-sensor"
|
|
];
|
|
|
|
config = lib.mkIf config.modules.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.modules.to fix fingerprint integration";
|
|
wantedBy = targets;
|
|
after = targets;
|
|
serviceConfig.ExecStart = "systemctl restart open-fprintd python3-validity";
|
|
};
|
|
|
|
services."06cb-009a-fingerprint-sensor" = {
|
|
enable = true;
|
|
backend = "python-validity";
|
|
calib-data-file = config.modules.fingerprint-fix.calibDataFile;
|
|
};
|
|
|
|
security.pam.services.su.fprintAuth = true;
|
|
security.pam.services.sudo.fprintAuth = true;
|
|
security.pam.services.login.fprintAuth = true;
|
|
security.pam.services.greetd.fprintAuth = true;
|
|
};
|
|
}
|