summary refs log tree commit diff
path: root/nixos/modules/services/networking/logmein-hamachi.nix
blob: 11cbdda2f845b4ba79da83c3c1d4dcbf38e78263 (plain) (blame)
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, ... }:

with lib;

let

  cfg = config.services.logmein-hamachi;

in

{

  ###### interface

  options = {

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

  };


  ###### implementation

  config = 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 ];

  };

}