Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add myself as maintainer, fetchurl -> fetchgit, update rev #3

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
./programs/wavemon.nix
./programs/waybar.nix
./programs/wireshark.nix
./programs/wshowkeys.nix
./programs/x2goserver.nix
./programs/xfs_quota.nix
./programs/xonsh.nix
Expand Down
22 changes: 22 additions & 0 deletions nixos/modules/programs/wshowkeys.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ 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.source = "${pkgs.wshowkeys}/bin/wshowkeys";
};
}
33 changes: 33 additions & 0 deletions pkgs/tools/wayland/wshowkeys/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ stdenv, fetchgit
, meson, pkg-config, wayland, ninja
, cairo, libinput, pango, wayland-protocols, libxkbcommon
}:

stdenv.mkDerivation rec {
pname = "wshowkeys-unstable";
version = "2020-03-29";

src = fetchgit {
url = "https://git.sr.ht/~sircmpwn/wshowkeys";
rev = "6388a49e0f431d6d5fcbd152b8ae4fa8e87884ee";
sha256 = "etXXNxspnJOoVu2tL/EOxW04vuxqQ3719YuzomRzaoI=";
};

nativeBuildInputs = [ meson pkg-config wayland ninja ];
buildInputs = [ cairo libinput pango wayland-protocols libxkbcommon ];

meta = with stdenv.lib; {
description = "Displays keys being pressed on a Wayland session";
longDescription = ''
Displays keypresses on screen on supported Wayland compositors (requires
wlr_layer_shell_v1 support).
Note: This tool requires root permissions to read input events, but these
permissions are dropped after startup. The NixOS module provides such a
setuid binary (use "programs.wshowkeys.enable = true;").
'';
homepage = "https://git.sr.ht/~sircmpwn/wshowkeys";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ primeos berbiche ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,8 @@ in

wob = callPackage ../tools/misc/wob { };

wshowkeys = callPackage ../tools/wayland/wshowkeys { };

xob = callPackage ../tools/X11/xob { };

z-lua = callPackage ../tools/misc/z-lua { };
Expand Down