Distributed Erlang over iroh P2P + TLS, with a bot powers SDK
0

Configure Feed

Select the types of activity you want to include in your feed.

erl-iroh / flake.nix
2.8 kB 107 lines
1{ 2 description = "erl_iroh distributed Erlang over iroh P2P + TLS, with a bot powers SDK"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 flake-utils.url = "github:numtide/flake-utils"; 7 }; 8 9 outputs = 10 { 11 self, 12 nixpkgs, 13 flake-utils, 14 }: 15 flake-utils.lib.eachDefaultSystem ( 16 system: 17 let 18 pkgs = import nixpkgs { inherit system; }; 19 inherit (pkgs) lib; 20 21 erl-iroh = pkgs.rustPlatform.buildRustPackage { 22 pname = "erl-iroh"; 23 version = "0.1.0"; 24 src = lib.cleanSourceWith { 25 src = ./.; 26 filter = 27 path: type: 28 let 29 base = baseNameOf path; 30 in 31 !( 32 lib.hasInfix "/target" path 33 || lib.hasInfix "/.git" path 34 || base == "target" 35 || base == "result" 36 || base == ".git" 37 ); 38 }; 39 40 cargoLock.lockFile = ./Cargo.lock; 41 42 nativeBuildInputs = [ 43 pkgs.pkg-config 44 pkgs.cmake 45 pkgs.perl 46 ]; 47 48 # aws-lc-sys / ring need a C toolchain; no OpenSSL linkage required. 49 doCheck = true; 50 # Integration-style unit tests are pure; keep checks on. 51 checkFlags = [ ]; 52 53 meta = { 54 description = "Distributed Erlang over iroh P2P + TLS, bot powers SDK"; 55 homepage = "https://tangled.org/nandi.uk/erl-iroh"; 56 license = with lib.licenses; [ 57 mit 58 asl20 59 ]; 60 mainProgram = "erl-iroh-demo"; 61 }; 62 }; 63 in 64 { 65 packages.default = erl-iroh; 66 packages.erl-iroh = erl-iroh; 67 68 # Default app: in-process two-bot iroh handshake demo 69 apps.default = { 70 type = "app"; 71 program = "${erl-iroh}/bin/erl-iroh-demo"; 72 }; 73 apps.demo = { 74 type = "app"; 75 program = "${erl-iroh}/bin/erl-iroh-demo"; 76 }; 77 apps.bot = { 78 type = "app"; 79 program = "${erl-iroh}/bin/erl-iroh-bot"; 80 }; 81 apps.peer = { 82 type = "app"; 83 program = "${erl-iroh}/bin/erl-iroh-peer"; 84 }; 85 86 devShells.default = pkgs.mkShell { 87 packages = [ 88 pkgs.rustc 89 pkgs.cargo 90 pkgs.rustfmt 91 pkgs.clippy 92 pkgs.pkg-config 93 pkgs.cmake 94 pkgs.perl 95 pkgs.rust-analyzer 96 ]; 97 shellHook = '' 98 echo "erl-iroh dev shell" 99 echo " cargo run --bin erl-iroh-demo" 100 echo " nix run .#demo" 101 ''; 102 }; 103 104 formatter = pkgs.nixfmt-rfc-style; 105 } 106 ); 107}