From 2a2aa957d9649fcb0a841905927dff66cc2c570c Mon Sep 17 00:00:00 2001 From: oluceps Date: Sat, 29 Jul 2023 16:48:10 +0800 Subject: [PATCH] juicity: init at 0.1.0 --- pkgs/tools/networking/juicity/default.nix | 46 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/tools/networking/juicity/default.nix diff --git a/pkgs/tools/networking/juicity/default.nix b/pkgs/tools/networking/juicity/default.nix new file mode 100644 index 000000000000..0f56f98589e5 --- /dev/null +++ b/pkgs/tools/networking/juicity/default.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitHub +, buildGoModule +}: +buildGoModule rec { + pname = "juicity"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "juicity"; + repo = pname; + rev = "v${version}"; + hash = "sha256-JuV9nIFyT2AO0baayVSiKiVDH1waRsqqIp9I4KZ9Xu4="; + }; + + vendorHash = "sha256-xrSy6ZUbmUrRZ+vXBo9VPdhsbD/RV19xBHvNuhDWOPo="; + + proxyVendor = true; + + ldflags = [ + "-X=github.com/juicity/juicity/config.Version=${version}" + ]; + + subPackages = [ + "cmd/server" + "cmd/client" + ]; + + postInstall = '' + mv $out/bin/client $out/bin/juicity-client + mv $out/bin/server $out/bin/juicity-server + install -Dm444 install/juicity-server.service $out/lib/systemd/system/juicity-server.service + install -Dm444 install/juicity-client.service $out/lib/systemd/system/juicity-client.service + substituteInPlace $out/lib/systemd/system/juicity-server.service \ + --replace /usr/bin/juicity-server $out/bin/juicity-server + substituteInPlace $out/lib/systemd/system/juicity-client.service \ + --replace /usr/bin/juicity-client $out/bin/juicity-client + ''; + + meta = with lib; { + homepage = "https://github.com/juicity/juicity"; + description = "A quic-based proxy protocol"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ oluceps ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c48b73f18c0..db995e2e4e78 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9313,6 +9313,8 @@ with pkgs; juicefs = callPackage ../tools/filesystems/juicefs { }; + juicity = callPackage ../tools/networking/juicity { }; + jmtpfs = callPackage ../tools/filesystems/jmtpfs { }; jnettop = callPackage ../tools/networking/jnettop { };