wshowkeys: add cfg.package option
This commit is contained in:
parent
759b885493
commit
91322305eb
@ -1,27 +1,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.wshowkeys;
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ primeos ];
|
||||
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.wshowkeys = {
|
||||
enable = mkEnableOption ''
|
||||
enable = lib.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'';
|
||||
package = lib.mkPackageOption pkgs "wshowkeys" { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
security.wrappers.wshowkeys =
|
||||
{ setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.wshowkeys}/bin/wshowkeys";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.wrappers.wshowkeys = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = lib.getExe cfg.package;
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ primeos ];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user