2023-06-19 01:36:50 -04:00
|
|
|
{
|
2024-02-07 15:32:27 -05:00
|
|
|
lib,
|
2024-06-08 22:21:04 -04:00
|
|
|
pkgs,
|
|
|
|
self,
|
2023-11-22 15:33:16 -05:00
|
|
|
...
|
2023-12-01 16:53:51 -05:00
|
|
|
}: let
|
2024-02-07 15:32:27 -05:00
|
|
|
inherit (lib) mkDefault mkBefore;
|
2024-06-08 22:21:04 -04:00
|
|
|
inherit (self.packages.${pkgs.system}) pam-fprint-grosshack;
|
2024-02-07 15:32:27 -05:00
|
|
|
|
|
|
|
pam_fprintd_grosshackSo = "${pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so";
|
|
|
|
|
|
|
|
# https://wiki.archlinux.org/title/Fprint#Login_configuration
|
|
|
|
grosshackConf = ''
|
|
|
|
# pam-fprint-grosshack
|
2024-06-08 22:21:04 -04:00
|
|
|
auth sufficient ${pam_fprintd_grosshackSo} timeout=99
|
|
|
|
auth sufficient pam_unix.so try_first_pass nullok
|
2024-02-07 15:32:27 -05:00
|
|
|
'';
|
2023-12-01 16:53:51 -05:00
|
|
|
in {
|
2024-08-07 09:57:32 -04:00
|
|
|
services.fprintd.enable = true;
|
2023-06-19 01:36:50 -04:00
|
|
|
|
2023-06-20 15:24:07 -04:00
|
|
|
# https://www.reddit.com/r/NixOS/comments/z7i83r/fingertip_tip_start_fprintd_at_boot_for_a_quick/
|
2023-06-19 01:36:50 -04:00
|
|
|
systemd.services.fprintd = {
|
2023-11-22 15:33:16 -05:00
|
|
|
wantedBy = ["multi-user.target"];
|
2023-06-19 01:36:50 -04:00
|
|
|
serviceConfig.Type = "simple";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.logind.lidSwitch = "lock";
|
|
|
|
|
|
|
|
security.sudo.extraConfig = ''
|
2023-08-09 22:09:48 -04:00
|
|
|
Defaults timestamp_timeout=600
|
2023-06-19 01:36:50 -04:00
|
|
|
'';
|
|
|
|
|
2024-02-07 15:32:27 -05:00
|
|
|
# https://stackoverflow.com/a/47041843
|
2023-06-19 01:36:50 -04:00
|
|
|
security.pam.services = {
|
2024-02-08 15:51:28 -05:00
|
|
|
sudo.text = mkDefault (mkBefore grosshackConf);
|
|
|
|
login.text = mkDefault (mkBefore grosshackConf);
|
|
|
|
polkit-1.text = mkDefault (mkBefore grosshackConf);
|
2023-06-19 01:36:50 -04:00
|
|
|
};
|
|
|
|
}
|