Unverified Commit 91322305 authored by Austin Horstman's avatar Austin Horstman
Browse files

wshowkeys: add cfg.package option

parent 759b8854
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
{ 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;
  config = lib.mkIf cfg.enable {
    security.wrappers.wshowkeys = {
      setuid = true;
      owner = "root";
      group = "root";
        source = "${pkgs.wshowkeys}/bin/wshowkeys";
      source = lib.getExe cfg.package;
    };
  };

  meta.maintainers = with lib.maintainers; [ primeos ];
}