1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let cfg = config.services.touchegg;
6
7in {
8 meta = {
9 maintainers = teams.pantheon.members;
10 };
11
12 ###### interface
13 options.services.touchegg = {
14 enable = mkEnableOption (lib.mdDoc "touchegg, a multi-touch gesture recognizer");
15
16 package = mkOption {
17 type = types.package;
18 default = pkgs.touchegg;
19 defaultText = literalExpression "pkgs.touchegg";
20 description = lib.mdDoc "touchegg derivation to use.";
21 };
22 };
23
24 ###### implementation
25 config = mkIf cfg.enable {
26 systemd.services.touchegg = {
27 description = "Touchegg Daemon";
28 serviceConfig = {
29 Type = "simple";
30 ExecStart = "${cfg.package}/bin/touchegg --daemon";
31 Restart = "on-failure";
32 };
33 wantedBy = [ "multi-user.target" ];
34 };
35
36 environment.systemPackages = [ cfg.package ];
37 };
38}