summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/networking/logmein-hamachi.nix
blob: d0ce1b53267e448722c24df930730429bf541432 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
{
  config,
  lib,
  pkgs,
  ...
}:
let

  cfg = config.services.logmein-hamachi;

in

{

  ###### interface

  options = {

    services.logmein-hamachi.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Whether to enable LogMeIn Hamachi, a proprietary
        (closed source) commercial VPN software.
      '';
    };

  };

  ###### implementation

  config = lib.mkIf cfg.enable {

    systemd.services.logmein-hamachi = {
      description = "LogMeIn Hamachi Daemon";

      wantedBy = [ "multi-user.target" ];
      after = [ "network.target" ];

      serviceConfig = {
        Type = "forking";
        ExecStart = "${pkgs.logmein-hamachi}/bin/hamachid";
      };
    };

    environment.systemPackages = [ pkgs.logmein-hamachi ];

  };

}