3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services/monitoring/teamviewer.nix

50 lines
1 KiB
Nix
Raw Normal View History

2015-04-05 15:19:19 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.teamviewer;
in
{
###### interface
options = {
services.teamviewer.enable = mkEnableOption "TeamViewer daemon";
2015-04-05 15:19:19 +01:00
};
###### implementation
config = mkIf (cfg.enable) {
environment.systemPackages = [ pkgs.teamviewer ];
services.dbus.packages = [ pkgs.teamviewer ];
2015-04-05 15:19:19 +01:00
systemd.services.teamviewerd = {
description = "TeamViewer remote control daemon";
wantedBy = [ "multi-user.target" ];
after = [ "NetworkManager-wait-online.service" "network.target" "dbus.service" ];
requires = [ "dbus.service" ];
preStart = "mkdir -pv /var/lib/teamviewer /var/log/teamviewer";
2015-04-05 15:19:19 +01:00
startLimitIntervalSec = 60;
startLimitBurst = 10;
2015-04-05 15:19:19 +01:00
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.teamviewer}/bin/teamviewerd -f";
2015-04-05 15:19:19 +01:00
PIDFile = "/run/teamviewerd.pid";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Restart = "on-abort";
};
};
};
}