@@ -0,0 +1,34 @@
1+{ stdenv, fetchurl, openssl, lzo, zlib, gcc }:
2+
3+with stdenv.lib;
4+
5+stdenv.mkDerivation rec {
6+ version = "1.0.2";
7+ name = "zerotierone";
8+
9+ src = fetchurl {
10+ url = "https://github.com/zerotier/ZeroTierOne/archive/${version}.tar.gz";
11+ sha256 = "002ay4f6l9h79j1708klwjvinsv6asv24a0hql85jq27587sv6mq";
12+ };
13+
14+ preConfigure = ''
15+ substituteInPlace ./make-linux.mk \
16+ --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc";
17+ substituteInPlace ./make-linux.mk \
18+ --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++";
19+ '';
20+
21+ buildInputs = [ openssl lzo zlib gcc ];
22+
23+ installPhase = ''
24+ installBin zerotier-one
25+ '';
26+
27+ meta = {
28+ description = "Create flat virtual Ethernet networks of almost unlimited size";
29+ homepage = https://www.zerotier.com;
30+ license = stdenv.lib.licenses.gpl3;
31+ maintainers = [ stdenv.lib.maintainers.sjmackenzie ];
32+ platforms = stdenv.lib.platforms.all;
33+ };
34+}