1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-19 07:59:24 +03:00
nixpkgs/nixos/modules/services/misc/logkeys.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
823 B
Nix
Raw Normal View History

2017-12-23 01:08:05 +01:00
{ config, lib, pkgs, ... }:
2017-04-26 00:53:50 +02:00
let
cfg = config.services.logkeys;
in {
options.services.logkeys = {
enable = lib.mkEnableOption "logkeys, a keylogger service";
2018-02-21 08:11:33 +01:00
device = lib.mkOption {
2018-02-21 08:11:33 +01:00
description = "Use the given device as keyboard input event device instead of /dev/input/eventX default.";
default = null;
type = lib.types.nullOr lib.types.str;
2018-02-21 08:11:33 +01:00
example = "/dev/input/event15";
};
2017-04-26 00:53:50 +02:00
};
config = lib.mkIf cfg.enable {
2017-04-26 00:53:50 +02:00
systemd.services.logkeys = {
description = "LogKeys Keylogger Daemon";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
2018-02-21 08:11:33 +01:00
ExecStart = "${pkgs.logkeys}/bin/logkeys -s${lib.optionalString (cfg.device != null) " -d ${cfg.device}"}";
2017-04-26 00:53:50 +02:00
ExecStop = "${pkgs.logkeys}/bin/logkeys -k";
Type = "forking";
};
};
};
}