mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
fedd7cd690
This is slightly more verbose and inconvenient, but it forces you to think about what the wrapper ownership and permissions will be.
28 lines
628 B
Nix
28 lines
628 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.wshowkeys;
|
|
in {
|
|
meta.maintainers = with maintainers; [ primeos ];
|
|
|
|
options = {
|
|
programs.wshowkeys = {
|
|
enable = mkEnableOption ''
|
|
wshowkeys (displays keypresses on screen on supported Wayland
|
|
compositors). It requires root permissions to read input events, but
|
|
these permissions are dropped after startup'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
security.wrappers.wshowkeys =
|
|
{ setuid = true;
|
|
owner = "root";
|
|
group = "root";
|
|
source = "${pkgs.wshowkeys}/bin/wshowkeys";
|
|
};
|
|
};
|
|
}
|