about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-07-01 11:54:38 +0200
committerGitHub <noreply@github.com>2022-07-01 11:54:38 +0200
commit911a73340c75ac9b6fb0d92aec2c0bff3c9d19a0 (patch)
treee99b31d6afae05034f4c9cee39af206a7cb00b63 /pkgs/applications/networking/p2p
parent5932186344b312cbb3fa9b0b0be7a90b688843ae (diff)
parent69e1e00ebbdf40c1a1b2cc622f7e58aa927b4044 (diff)
Merge pull request #175335 from wyndon/init-lokinet
Diffstat (limited to 'pkgs/applications/networking/p2p')
-rw-r--r--pkgs/applications/networking/p2p/lokinet/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/applications/networking/p2p/lokinet/default.nix b/pkgs/applications/networking/p2p/lokinet/default.nix
new file mode 100644
index 0000000000000..e3e2c8e588313
--- /dev/null
+++ b/pkgs/applications/networking/p2p/lokinet/default.nix
@@ -0,0 +1,64 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, libevent
+, libsodium
+, libuv
+, nlohmann_json
+, pkg-config
+, sqlite
+, systemd
+, unbound
+, zeromq
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lokinet";
+  version = "0.9.9";
+
+  src = fetchFromGitHub {
+    owner = "oxen-io";
+    repo = "lokinet";
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "sha256-AaGsRg9S9Cng9emI/mN09QSOIRbE+x3916clWAwLnRs=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    libevent
+    libuv
+    libsodium
+    nlohmann_json
+    sqlite
+    systemd
+    unbound
+    zeromq
+  ];
+
+  cmakeFlags = [
+    "-DGIT_VERSION=v${version}"
+    "-DWITH_BOOTSTRAP=OFF" # we provide bootstrap files manually
+    "-DWITH_SETCAP=OFF"
+  ];
+
+  # copy bootstrap files
+  # see https://github.com/oxen-io/lokinet/issues/1765#issuecomment-938208774
+  postInstall = ''
+    mkdir -p $out/share/testnet
+    cp $src/contrib/bootstrap/mainnet.signed $out/share/bootstrap.signed
+    cp $src/contrib/bootstrap/testnet.signed $out/share/testnet/bootstrap.signed
+  '';
+
+  meta = with lib; {
+    description = "Anonymous, decentralized and IP based overlay network for the internet";
+    homepage = "https://lokinet.org/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ wyndon ];
+  };
+}