forked from mirrors/nixpkgs
ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
50 lines
1 KiB
Nix
50 lines
1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.teamviewer;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.teamviewer.enable = mkEnableOption (lib.mdDoc "TeamViewer daemon");
|
|
|
|
};
|
|
|
|
###### implementation
|
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
environment.systemPackages = [ pkgs.teamviewer ];
|
|
|
|
services.dbus.packages = [ pkgs.teamviewer ];
|
|
|
|
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";
|
|
|
|
startLimitIntervalSec = 60;
|
|
startLimitBurst = 10;
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.teamviewer}/bin/teamviewerd -f";
|
|
PIDFile = "/run/teamviewerd.pid";
|
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
|
Restart = "on-abort";
|
|
};
|
|
};
|
|
};
|
|
|
|
}
|