{ lib, lld, fetchFromGitHub, rustPlatform, }: let mkIrohPackage = { name, cargoFeatures ? [ ], }: rustPlatform.buildRustPackage rec { pname = name; version = "1.0.3"; src = fetchFromGitHub { owner = "n0-computer"; repo = "iroh"; rev = "v${version}"; hash = "sha256-qZft++kZytCC49WK3uqpsdI4Ko3YdBFEws31kZ7SM2Q="; }; cargoHash = "sha256-8u3vkP0wCNzLaT6Bb1wnBzl7c1req8NsAhj2zbT6EtE="; buildFeatures = cargoFeatures; cargoBuildFlags = [ "--bin" name ]; nativeBuildInputs = [ lld ]; # Some tests require network access which is not available in nix build sandbox. doCheck = false; meta = { description = "Efficient IPFS for the whole world right now"; homepage = "https://iroh.computer"; license = with lib.licenses; [ asl20 mit ]; maintainers = with lib.maintainers; [ andreashgk ]; mainProgram = name; }; }; in { iroh-dns-server = mkIrohPackage { name = "iroh-dns-server"; }; iroh-relay = mkIrohPackage { name = "iroh-relay"; cargoFeatures = [ "server" ]; }; }