about summary refs log tree commit diff
path: root/pkgs/by-name/be/bee/package.nix
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-04-01 19:33:03 +0200
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2024-04-01 19:33:03 +0200
commit7b9dc63ae0a39780af3d70bb80d6eda8937a2c27 (patch)
treed63f752bd0cffbeb48de050f88a43a9e9e926c74 /pkgs/by-name/be/bee/package.nix
parent0a8bbd48dcb79fff66c47669b7f00d540130a4eb (diff)
bee: move to pkgs/by-name
Diffstat (limited to 'pkgs/by-name/be/bee/package.nix')
-rw-r--r--pkgs/by-name/be/bee/package.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/by-name/be/bee/package.nix b/pkgs/by-name/be/bee/package.nix
new file mode 100644
index 0000000000000..9fd7752b2c2e1
--- /dev/null
+++ b/pkgs/by-name/be/bee/package.nix
@@ -0,0 +1,56 @@
+{ lib
+, fetchFromGitHub
+, buildGoModule
+}:
+
+buildGoModule rec {
+  pname = "bee";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "ethersphere";
+    repo = "bee";
+    rev = "v${version}";
+    sha256 = "sha256-gZDmFufk/zBftQe7Ju4rDpZqw0hm2nf9YQg1Oa8540s=";
+  };
+
+  vendorHash = "sha256-GpazHMQ8xZ6P7mADvsG3bXxDxEWnCJRIsBwDnL/McZA=";
+
+  subPackages = [ "cmd/bee" ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X github.com/ethersphere/bee.version=${version}"
+    "-X github.com/ethersphere/bee/pkg/api.Version=5.2.0"
+    "-X github.com/ethersphere/bee/pkg/api.DebugVersion=4.1.0"
+    "-X github.com/ethersphere/bee/pkg/p2p/libp2p.reachabilityOverridePublic=false"
+    "-X github.com/ethersphere/bee/pkg/postage/listener.batchFactorOverridePublic=5"
+  ];
+
+  CGO_ENABLED = 0;
+
+  postInstall = ''
+    mkdir -p $out/lib/systemd/system
+    cp packaging/bee.service $out/lib/systemd/system/
+    cp packaging/bee-get-addr $out/bin/
+    chmod +x $out/bin/bee-get-addr
+    patchShebangs $out/bin/
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/ethersphere/bee";
+    description = "Ethereum Swarm Bee";
+    longDescription = ''
+      A decentralised storage and communication system for a sovereign digital society.
+
+      Swarm is a system of peer-to-peer networked nodes that create a decentralised storage
+      and communication service. The system is economically self-sustaining due to a built-in
+      incentive system enforced through smart contracts on the Ethereum blockchain.
+
+      Bee is a Swarm node implementation, written in Go.
+    '';
+    license = with licenses; [ bsd3 ];
+    maintainers = with maintainers; [ ];
+  };
+}