2021-04-29 22:56:38 +02:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, llvmPackages, sqlite, installShellFiles, Security, libiconv }:
|
2021-04-19 04:33:03 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "innernet";
|
2021-04-26 03:46:24 +02:00
|
|
|
version = "1.2.0";
|
2021-04-19 04:33:03 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tonarino";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-04-26 03:46:24 +02:00
|
|
|
sha256 = "sha256-Z4F5RYPVgFiiDBg6lxILjAh/a/rL7IJBqHIJ/tQyLnE=";
|
2021-04-19 04:33:03 +02:00
|
|
|
};
|
2021-04-26 20:04:25 +02:00
|
|
|
cargoSha256 = "sha256-WSkN5aXMgfqZJAV1b3elF7kwf2f5OpcntKSf8620YcY=";
|
2021-04-19 04:33:03 +02:00
|
|
|
|
2021-04-26 20:04:25 +02:00
|
|
|
nativeBuildInputs = with llvmPackages; [
|
|
|
|
llvm
|
|
|
|
clang
|
|
|
|
installShellFiles
|
|
|
|
];
|
2021-04-29 22:56:38 +02:00
|
|
|
buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
|
2021-04-26 20:04:25 +02:00
|
|
|
|
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage doc/innernet-server.8.gz
|
|
|
|
installManPage doc/innernet.8.gz
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
if [[ "$("$out/bin/${pname}"-server --version)" == "${pname}-server ${version}" ]]; then
|
|
|
|
echo '${pname}-server smoke check passed'
|
|
|
|
else
|
|
|
|
echo '${pname}-server smoke check failed'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
if [[ "$("$out/bin/${pname}" --version)" == "${pname} ${version}" ]]; then
|
|
|
|
echo '${pname} smoke check passed'
|
|
|
|
else
|
|
|
|
echo '${pname} smoke check failed'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
'';
|
2021-04-19 04:33:03 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A private network system that uses WireGuard under the hood";
|
|
|
|
homepage = "https://github.com/tonarino/innernet";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ tomberek _0x4A6F ];
|
|
|
|
};
|
|
|
|
}
|