tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
toxvpn: 20161230 -> 2017-06-25
michael bishop
8 years ago
bb16bced
bd63daae
+31
-10
2 changed files
expand all
collapse all
unified
split
nixos
modules
services
networking
toxvpn.nix
pkgs
tools
networking
toxvpn
default.nix
+15
-1
nixos/modules/services/networking/toxvpn.nix
···
18
default = 33445;
19
description = "udp port for toxcore, port-forward to help with connectivity if you run many nodes behind one NAT";
20
};
0
0
0
0
0
0
0
21
};
22
};
23
···
33
chown toxvpn /run/toxvpn
34
'';
35
0
0
0
0
0
0
36
serviceConfig = {
37
-
ExecStart = "${pkgs.toxvpn}/bin/toxvpn -i ${config.services.toxvpn.localip} -l /run/toxvpn/control -u toxvpn -p ${toString config.services.toxvpn.port}";
38
KillMode = "process";
39
Restart = "on-success";
40
Type = "notify";
···
42
43
restartIfChanged = false; # Likely to be used for remote admin
44
};
0
0
45
46
users.extraUsers = {
47
toxvpn = {
···
18
default = 33445;
19
description = "udp port for toxcore, port-forward to help with connectivity if you run many nodes behind one NAT";
20
};
21
+
22
+
auto_add_peers = mkOption {
23
+
type = types.listOf types.string;
24
+
default = [];
25
+
example = ''[ "toxid1" "toxid2" ]'';
26
+
description = "peers to automacally connect to on startup";
27
+
};
28
};
29
};
30
···
40
chown toxvpn /run/toxvpn
41
'';
42
43
+
path = [ pkgs.toxvpn ];
44
+
45
+
script = ''
46
+
exec toxvpn -i ${config.services.toxvpn.localip} -l /run/toxvpn/control -u toxvpn -p ${toString config.services.toxvpn.port} ${lib.concatMapStringsSep " " (x: "-a ${x}") config.services.toxvpn.auto_add_peers}
47
+
'';
48
+
49
serviceConfig = {
0
50
KillMode = "process";
51
Restart = "on-success";
52
Type = "notify";
···
54
55
restartIfChanged = false; # Likely to be used for remote admin
56
};
57
+
58
+
environment.systemPackages = [ pkgs.toxvpn ];
59
60
users.extraUsers = {
61
toxvpn = {
+16
-9
pkgs/tools/networking/toxvpn/default.nix
···
1
-
{ stdenv, fetchFromGitHub, cmake, lib
2
-
, libtoxcore, jsoncpp, libsodium, systemd, libcap }:
3
4
-
with lib;
5
6
-
stdenv.mkDerivation rec {
0
0
0
7
name = "toxvpn-${version}";
8
-
version = "20161230";
9
10
src = fetchFromGitHub {
11
owner = "cleverca22";
12
repo = "toxvpn";
13
-
rev = "4b7498a5fae680484cb5779ac01fb08ad3089bdd";
14
-
sha256 = "0bazdspiym9xyzms7pd6i1f2gph13rnf764nm3jc27fbfwmc98rp";
15
};
16
17
-
buildInputs = [ libtoxcore jsoncpp libsodium libcap ] ++ optional stdenv.isLinux systemd;
0
0
18
nativeBuildInputs = [ cmake ];
19
20
cmakeFlags = optional stdenv.isLinux [ "-DSYSTEMD=1" ];
21
0
0
22
meta = with stdenv.lib; {
23
description = "A powerful tool that allows one to make tunneled point to point connections over Tox";
24
homepage = https://github.com/cleverca22/toxvpn;
25
license = licenses.gpl3;
26
maintainers = with maintainers; [ cleverca22 obadz ];
27
-
platforms = platforms.linux;
28
};
29
}
···
1
+
{ stdenv, fetchFromGitHub, cmake, nlohmann_json,
2
+
libtoxcore, libsodium, systemd, libcap, zeromq }:
3
4
+
with stdenv.lib;
5
6
+
let
7
+
systemdOrNull = if stdenv.system == "x86_64-darwin" then null else systemd;
8
+
if_systemd = optional (systemdOrNull != null);
9
+
in stdenv.mkDerivation rec {
10
name = "toxvpn-${version}";
11
+
version = "2017-06-25";
12
13
src = fetchFromGitHub {
14
owner = "cleverca22";
15
repo = "toxvpn";
16
+
rev = "7bd6f169d69c511affa8c9672e8f794e4e205a44";
17
+
sha256 = "1km8hkrxmrnca1b49vbw5kyldayaln5plvz78vhf8325r6c5san0";
18
};
19
20
+
buildInputs = [ libtoxcore nlohmann_json libsodium zeromq ]
21
+
++ if_systemd systemd
22
+
++ optional (stdenv.system != "x86_64-darwin") libcap;
23
nativeBuildInputs = [ cmake ];
24
25
cmakeFlags = optional stdenv.isLinux [ "-DSYSTEMD=1" ];
26
27
+
postInstall = "$out/bin/toxvpn -h";
28
+
29
meta = with stdenv.lib; {
30
description = "A powerful tool that allows one to make tunneled point to point connections over Tox";
31
homepage = https://github.com/cleverca22/toxvpn;
32
license = licenses.gpl3;
33
maintainers = with maintainers; [ cleverca22 obadz ];
34
+
platforms = platforms.linux ++ platforms.darwin;
35
};
36
}