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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.6 KiB
Nix
Raw Normal View History

2021-12-06 09:26:58 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, sqlite
, installShellFiles
, Security
, libiconv
, innernet
, testers
2021-12-06 09:26:58 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "innernet";
2024-01-22 18:31:34 +00:00
version = "1.6.1";
src = fetchFromGitHub {
owner = "tonarino";
2021-11-11 20:41:53 +00:00
repo = "innernet";
2023-06-24 20:46:19 +00:00
rev = "refs/tags/v${version}";
2024-01-22 18:31:34 +00:00
hash = "sha256-dFMAzLvPO5xAfJqUXdiLf13uh5H5ay+CI9aop7Fhprk=";
};
2023-06-24 20:46:19 +00:00
2024-01-22 18:31:34 +00:00
cargoHash = "sha256-39LryfisVtNMX2XLPh/AEQ1KzVtwdE3wuTaTbxGMaBI=";
2023-05-26 19:37:52 +00:00
nativeBuildInputs = [
rustPlatform.bindgenHook
installShellFiles
];
2023-06-24 20:46:19 +00:00
buildInputs = [
sqlite
] ++ lib.optionals stdenv.isDarwin [
Security
libiconv
];
postInstall = ''
installManPage doc/innernet-server.8.gz
installManPage doc/innernet.8.gz
2021-06-01 18:38:30 +00:00
installShellCompletion doc/innernet.completions.{bash,fish,zsh}
installShellCompletion doc/innernet-server.completions.{bash,fish,zsh}
'' + (lib.optionalString stdenv.isLinux ''
2022-05-23 15:00:41 +00:00
find . -regex '.*\.\(target\|service\)' | xargs install -Dt $out/lib/systemd/system
find $out/lib/systemd/system -type f | xargs sed -i "s|/usr/bin/innernet|$out/bin/innernet|"
'');
2021-12-06 09:26:58 +00:00
passthru.tests = {
serverVersion = testers.testVersion { package = innernet; command = "innernet-server --version"; };
version = testers.testVersion { package = innernet; command = "innernet --version"; };
2021-12-06 09:26:58 +00:00
};
meta = with lib; {
description = "A private network system that uses WireGuard under the hood";
homepage = "https://github.com/tonarino/innernet";
2023-06-24 20:46:19 +00:00
changelog = "https://github.com/tonarino/innernet/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ tomberek _0x4A6F ];
};
}