NiksOS/system/hardware/fingerprint.nix

31 lines
845 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
lib,
pkgs,
...
}: let
inherit (config.niksos) fingerprint desktop;
inherit (lib) mkIf mkEnableOption;
uwsm = lib.getExe pkgs.uwsm;
foot = lib.getExe pkgs.foot;
in {
options.niksos.fingerprint = mkEnableOption "fingerprint support.";
config = mkIf fingerprint {
services = {
fprintd.enable = true;
logind.extraConfig = mkIf desktop.hyprland ''
# dont shutdown when power button is short-pressed
HandlePowerKey=ignore
'';
};
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop.hyprland {
bind = [
", XF86PowerOff, exec, ${uwsm} app -- pgrep fprintd-verify && exit 0 || ${foot} -a 'foot-fprintd' sh -c 'fprintd-verify && systemctl sleep'"
];
windowrule = [
"float, class:foot-fprintd"
];
};
};
}