Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, rustPlatform 3, fetchFromGitHub 4, protobuf 5, rustfmt 6, stdenv 7, darwin 8, pkg-config 9, openssl 10}: 11 12let 13 version = "0.2.0"; 14 15 src = fetchFromGitHub { 16 owner = "talaia-labs"; 17 repo = "rust-teos"; 18 rev = "v${version}"; 19 hash = "sha256-UrzH9xmhVq12TcSUQ1AihCG1sNGcy/N8LDsZINVKFkY="; 20 }; 21 22 meta = with lib; { 23 homepage = "https://github.com/talaia-labs/rust-teos"; 24 license = licenses.mit; 25 maintainers = with maintainers; [ seberm ]; 26 }; 27 updateScript = ./update.sh; 28in 29{ 30 teos = rustPlatform.buildRustPackage { 31 pname = "teos"; 32 inherit version src; 33 34 cargoHash = "sha256-U0imKEPszlBOaS6xEd3kfzy/w2SYe3EY/E1e0L+ViDk="; 35 36 buildAndTestSubdir = "teos"; 37 38 nativeBuildInputs = [ 39 protobuf 40 rustfmt 41 ]; 42 43 buildInputs = lib.optionals stdenv.isDarwin [ 44 darwin.apple_sdk.frameworks.Security 45 ]; 46 47 passthru.updateScript = updateScript; 48 49 __darwinAllowLocalNetworking = true; 50 51 meta = meta // { 52 description = "A Lightning watchtower compliant with BOLT13, written in Rust"; 53 }; 54 }; 55 56 teos-watchtower-plugin = rustPlatform.buildRustPackage { 57 pname = "teos-watchtower-plugin"; 58 inherit version src; 59 60 cargoHash = "sha256-3ke1qTFw/4I5dPLuPjIGp1n2C/eRfPB7A6ErMFfwUzE="; 61 62 buildAndTestSubdir = "watchtower-plugin"; 63 64 nativeBuildInputs = [ 65 pkg-config 66 protobuf 67 rustfmt 68 ]; 69 70 buildInputs = [ 71 openssl 72 ] ++ lib.optionals stdenv.isDarwin [ 73 darwin.apple_sdk.frameworks.SystemConfiguration 74 ]; 75 76 passthru.updateScript = updateScript; 77 78 __darwinAllowLocalNetworking = true; 79 80 meta = meta // { 81 description = "A Lightning watchtower plugin for clightning"; 82 mainProgram = "watchtower-client"; 83 }; 84 }; 85}