NiksOS/system/hardware/fingerprint.nix

30 lines
781 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) hardware desktop;
inherit (lib) mkIf mkEnableOption;
uwsm = lib.getExe pkgs.uwsm;
foot = lib.getExe pkgs.foot;
in {
config = mkIf hardware.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"
];
};
};
}