nixos-configs/devices/wim/modules/security.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2023-06-19 01:36:50 -04:00
{
config,
lib,
2023-11-22 15:33:16 -05:00
...
}: let
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
'';
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
'';
# https://stackoverflow.com/a/47041843
2023-06-19 01:36:50 -04:00
security.pam.services = {
sudo.text = mkDefault (mkBefore grosshackConf);
login.text = mkDefault (mkBefore grosshackConf);
polkit-1.text = mkDefault (mkBefore grosshackConf);
# FIXME: sometimes can't use password
2024-04-19 17:01:09 -04:00
ags.text = mkDefault (mkBefore grosshackConf);
2023-06-19 01:36:50 -04:00
};
}