mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{ lib, stdenv, rustPlatform, fetchFromGitHub, llvmPackages, sqlite, installShellFiles, Security, libiconv }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "innernet";
|
|
version = "1.3.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tonarino";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-WqUkl9NZMMQJknASadLJz3CslrplGuXLrlv6fiwWFoI=";
|
|
};
|
|
cargoSha256 = "sha256-mexiI9EHL2L4RNXCk133vriI5IGpdxLVy6xnBIqEH30=";
|
|
|
|
nativeBuildInputs = with llvmPackages; [
|
|
llvm
|
|
clang
|
|
installShellFiles
|
|
];
|
|
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
|
|
'';
|
|
|
|
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 ];
|
|
};
|
|
}
|