63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
lld,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
}:
|
|
let
|
|
mkIrohPackage =
|
|
{
|
|
name,
|
|
cargoFeatures ? [ ],
|
|
}:
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = name;
|
|
version = "1.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "n0-computer";
|
|
repo = "iroh";
|
|
rev = "v${version}";
|
|
hash = "sha256-Tk9QXg+5Pu+xmfmo1FZRlshG3VLr3jTycybjKvnP9DU=";
|
|
};
|
|
|
|
cargoHash = "sha256-iLN2PJkWNyFPSNkAD/kgtmPb5c2HmMrhN+rUNoAnIFY=";
|
|
|
|
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" ];
|
|
};
|
|
}
|