nixpkgs-suyu/pkgs/tools/networking/innernet/default.nix

54 lines
1.6 KiB
Nix
Raw Normal View History

2021-04-29 22:56:38 +02:00
{ lib, stdenv, rustPlatform, fetchFromGitHub, llvmPackages, sqlite, installShellFiles, Security, libiconv }:
rustPlatform.buildRustPackage rec {
pname = "innernet";
2021-06-01 13:58:26 +02:00
version = "1.3.1";
src = fetchFromGitHub {
owner = "tonarino";
repo = pname;
rev = "v${version}";
2021-06-01 13:58:26 +02:00
sha256 = "sha256-Tnwq86gAbi24O8/26134gJCf9+wol1zma980t9iHEKY=";
};
2021-06-01 13:58:26 +02:00
cargoSha256 = "sha256-Wy+i1lmXpsy0Sy0GF5XUfXsLQHeV7cQo9nUxUEFnHOU=";
nativeBuildInputs = with llvmPackages; [
llvm
clang
installShellFiles
];
2021-04-29 22:56:38 +02:00
buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
postInstall = ''
installManPage doc/innernet-server.8.gz
installManPage doc/innernet.8.gz
2021-06-01 20:38:30 +02:00
installShellCompletion doc/innernet.completions.{bash,fish,zsh}
installShellCompletion doc/innernet-server.completions.{bash,fish,zsh}
'';
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
'';
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 ];
};
}