summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Justin Bauer <mjbauer95@gmail.com>2018-04-25 14:48:29 -0500
committerGitHub <noreply@github.com>2018-04-25 14:48:29 -0500
commita4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca (patch)
tree3017428e98ea9e9553d4194305f1d409a643a6d1
parentedf55489582a66272fd77d269969a2ea3d95c46f (diff)
parent1c3c80360b914ff8eacdabeb6d05565721121b1e (diff)
downloadnixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar.gz
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar.bz2
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar.lz
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar.xz
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.tar.zst
nixlib-a4a2626cd9d5a79c0c68ac0b0350c6e557e6d5ca.zip
Merge pull request #35280 from markus1189/logkeys
Logkeys: Update and add `device` option to service
-rw-r--r--nixos/modules/services/misc/logkeys.nix9
-rw-r--r--pkgs/tools/security/logkeys/default.nix13
2 files changed, 15 insertions, 7 deletions
diff --git a/nixos/modules/services/misc/logkeys.nix b/nixos/modules/services/misc/logkeys.nix
index df0b3ae24c90..ad13d9eaa674 100644
--- a/nixos/modules/services/misc/logkeys.nix
+++ b/nixos/modules/services/misc/logkeys.nix
@@ -7,6 +7,13 @@ let
 in {
   options.services.logkeys = {
     enable = mkEnableOption "logkeys service";
+
+    device = mkOption {
+      description = "Use the given device as keyboard input event device instead of /dev/input/eventX default.";
+      default = null;
+      type = types.nullOr types.string;
+      example = "/dev/input/event15";
+    };
   };
 
   config = mkIf cfg.enable {
@@ -14,7 +21,7 @@ in {
       description = "LogKeys Keylogger Daemon";
       wantedBy = [ "multi-user.target" ];
       serviceConfig = {
-        ExecStart = "${pkgs.logkeys}/bin/logkeys -s";
+        ExecStart = "${pkgs.logkeys}/bin/logkeys -s${lib.optionalString (cfg.device != null) " -d ${cfg.device}"}";
         ExecStop = "${pkgs.logkeys}/bin/logkeys -k";
         Type = "forking";
       };
diff --git a/pkgs/tools/security/logkeys/default.nix b/pkgs/tools/security/logkeys/default.nix
index e30ad30a4dc1..8a73d056b1ed 100644
--- a/pkgs/tools/security/logkeys/default.nix
+++ b/pkgs/tools/security/logkeys/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchgit, autoconf, automake, which, procps, kbd }:
+{ stdenv, fetchFromGitHub, autoconf, automake, which, procps, kbd }:
 
 stdenv.mkDerivation rec {
   name = "logkeys-${version}";
-  version = "2017-10-10";
+  version = "2018-01-22";
 
-  src = fetchgit {
-    url = https://github.com/kernc/logkeys;
-    rev = "5c368327a2cd818efaed4794633c260b90b87abf";
-    sha256 = "0akj7j775y9c0p53zq5v12jk3fy030fpdvn5m1x9w4rdj47vxdpg";
+  src = fetchFromGitHub {
+    owner = "kernc";
+    repo = "logkeys";
+    rev = "7a9f19fb6b152d9f00a0b3fe29ab266ff1f88129";
+    sha256 = "1k6kj0913imwh53lh6hrhqmrpygqg2h462raafjsn7gbd3vkgx8n";
   };
 
   buildInputs = [ autoconf automake which procps kbd ];