nixpkgs/nixos/modules/services/monitoring/teamviewer.nix

47 lines
932 B
Nix
Raw Normal View History

2015-04-05 14:19:19 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.teamviewer;
in
{
###### interface
options = {
services.teamviewer.enable = mkEnableOption "teamviewer daemon";
};
###### implementation
config = mkIf (cfg.enable) {
environment.systemPackages = [ pkgs.teamviewer ];
systemd.services.teamviewerd = {
description = "TeamViewer remote control daemon";
wantedBy = [ "graphical.target" ];
after = [ "NetworkManager-wait-online.service" "network.target" ];
2015-10-26 18:13:25 +00:00
preStart = "mkdir -pv /var/tmp/teamviewer10/{logs,config}";
2015-04-05 14:19:19 +00:00
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.teamviewer}/bin/teamviewerd -d";
PIDFile = "/run/teamviewerd.pid";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Restart = "on-abort";
StartLimitInterval = "60";
StartLimitBurst = "10";
};
};
};
}