nixpkgs/pkgs/tools/networking/zerotierone/default.nix

39 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute }:
2015-04-05 09:46:14 +03:00
with stdenv.lib;
stdenv.mkDerivation rec {
2015-11-19 23:15:58 +03:00
version = "1.1.0";
2015-04-05 09:46:14 +03:00
name = "zerotierone";
src = fetchurl {
url = "https://github.com/zerotier/ZeroTierOne/archive/${version}.tar.gz";
2015-11-19 23:15:58 +03:00
sha256 = "2d7ff178bd7fd284ebb7011d8a91bde51befda60f100eb5429a2dcb6626cf676";
2015-04-05 09:46:14 +03:00
};
preConfigure = ''
substituteInPlace ./make-linux.mk \
--replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc";
substituteInPlace ./make-linux.mk \
--replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++";
substituteInPlace ./osdep/LinuxEthernetTap.cpp \
--replace '/sbin/ip' "${iproute}/bin/ip"
2015-04-05 09:46:14 +03:00
'';
buildInputs = [ openssl lzo zlib gcc iproute ];
2015-04-05 09:46:14 +03:00
installPhase = ''
installBin zerotier-one
ln -s $out/bin/zerotier-one $out/bin/zerotier-idtool
ln -s $out/bin/zerotier-one $out/bin/zerotier-cli
2015-04-05 09:46:14 +03:00
'';
meta = {
description = "Create flat virtual Ethernet networks of almost unlimited size";
homepage = https://www.zerotier.com;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.sjmackenzie ];
platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ];
2015-04-05 09:46:14 +03:00
};
}