summary refs log tree commit diff
path: root/nixos/modules/services/x11/touchegg.nix
blob: 9d3678e7696dfcd22dd1bb2a1f5df93fd859a931 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ config, lib, pkgs, ... }:

with lib;

let cfg = config.services.touchegg;

in {
  meta = {
    maintainers = teams.pantheon.members;
  };

  ###### interface
  options.services.touchegg = {
    enable = mkEnableOption "touchegg, a multi-touch gesture recognizer";

    package = mkOption {
      type = types.package;
      default = pkgs.touchegg;
      defaultText = literalExpression "pkgs.touchegg";
      description = "touchegg derivation to use.";
    };
  };

  ###### implementation
  config = mkIf cfg.enable {
    systemd.services.touchegg = {
      description = "Touchegg Daemon";
      serviceConfig = {
        Type = "simple";
        ExecStart = "${cfg.package}/bin/touchegg --daemon";
        Restart = "on-failure";
      };
      wantedBy = [ "multi-user.target" ];
    };

    environment.systemPackages = [ cfg.package ];
  };
}