2023-06-19 01:36:50 -04:00
|
|
|
{
|
2023-12-01 16:53:51 -05:00
|
|
|
config,
|
2024-02-07 15:32:27 -05:00
|
|
|
lib,
|
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;
|
|
|
|
inherit (config.customPkgs) pam-fprint-grosshack;
|
|
|
|
|
|
|
|
pam_fprintd_grosshackSo = "${pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so";
|
|
|
|
|
|
|
|
# https://wiki.archlinux.org/title/Fprint#Login_configuration
|
|
|
|
grosshackConf = ''
|
|
|
|
# pam-fprint-grosshack
|
|
|
|
auth sufficient ${pam_fprintd_grosshackSo} timeout=99
|
|
|
|
auth sufficient pam_unix.so try_first_pass nullok
|
|
|
|
'';
|
2023-12-01 16:53:51 -05:00
|
|
|
in {
|
2023-06-19 01:36:50 -04:00
|
|
|
services.fprintd.enable = true;
|
|
|
|
|
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);
|
2024-03-03 17:18:59 -05:00
|
|
|
hyprlock.text = mkDefault (mkBefore grosshackConf);
|
2023-06-19 01:36:50 -04:00
|
|
|
};
|
|
|
|
}
|