2024-04-24 13:42:02 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2020-03-23 14:17:37 +00:00
|
|
|
let
|
|
|
|
cfg = config.programs.wshowkeys;
|
2024-04-24 13:42:02 +00:00
|
|
|
in
|
|
|
|
{
|
2020-03-23 14:17:37 +00:00
|
|
|
options = {
|
|
|
|
programs.wshowkeys = {
|
2024-04-24 13:42:02 +00:00
|
|
|
enable = lib.mkEnableOption ''
|
2020-03-23 14:17:37 +00:00
|
|
|
wshowkeys (displays keypresses on screen on supported Wayland
|
|
|
|
compositors). It requires root permissions to read input events, but
|
2024-04-13 12:54:15 +00:00
|
|
|
these permissions are dropped after startup'';
|
2024-04-24 13:42:02 +00:00
|
|
|
package = lib.mkPackageOption pkgs "wshowkeys" { };
|
2020-03-23 14:17:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-24 13:42:02 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
security.wrappers.wshowkeys = {
|
|
|
|
setuid = true;
|
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
|
|
|
source = lib.getExe cfg.package;
|
|
|
|
};
|
2020-03-23 14:17:37 +00:00
|
|
|
};
|
2024-04-24 13:42:02 +00:00
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ primeos ];
|
2020-03-23 14:17:37 +00:00
|
|
|
}
|