From 09982126409076abb35531f1db378355f9ec2600 Mon Sep 17 00:00:00 2001 From: Arseniy Seroka Date: Sun, 5 Apr 2015 17:19:19 +0300 Subject: [PATCH] impl: teamviewer daemon --- nixos/modules/module-list.nix | 1 + .../services/monitoring/teamviewer.nix | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 nixos/modules/services/monitoring/teamviewer.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 23809796878f..2ae568458d8e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -219,6 +219,7 @@ ./services/monitoring/smartd.nix ./services/monitoring/statsd.nix ./services/monitoring/systemhealth.nix + ./services/monitoring/teamviewer.nix ./services/monitoring/ups.nix ./services/monitoring/uptime.nix ./services/monitoring/zabbix-agent.nix diff --git a/nixos/modules/services/monitoring/teamviewer.nix b/nixos/modules/services/monitoring/teamviewer.nix new file mode 100644 index 000000000000..beba5dcd1b06 --- /dev/null +++ b/nixos/modules/services/monitoring/teamviewer.nix @@ -0,0 +1,45 @@ +{ 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" ]; + + 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"; + }; + }; + }; + +}