1 { config, lib, pkgs, ... }:
6 cfg = config.services.logkeys;
8 options.services.logkeys = {
9 enable = mkEnableOption (lib.mdDoc "logkeys service");
12 description = lib.mdDoc "Use the given device as keyboard input event device instead of /dev/input/eventX default.";
14 type = types.nullOr types.str;
15 example = "/dev/input/event15";
19 config = mkIf cfg.enable {
20 systemd.services.logkeys = {
21 description = "LogKeys Keylogger Daemon";
22 wantedBy = [ "multi-user.target" ];
24 ExecStart = "${pkgs.logkeys}/bin/logkeys -s${lib.optionalString (cfg.device != null) " -d ${cfg.device}"}";
25 ExecStop = "${pkgs.logkeys}/bin/logkeys -k";