From 1795ddbbe908360d051289e450eb2cf054b44dfc Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 12 Oct 2023 01:02:42 +0200 Subject: playing around with radicle.xyz this packages the heartwood cli tools, the radicle web interface, and runs a small example deployment on chaski. TODO: decide if i want to keep this thing, then add declarative config of the web interface, `rad auth`, and the radicle node to a NixOS module; the current state is kinda suboptimal to deploy. --- pkgs/radicle.nix | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkgs/radicle.nix (limited to 'pkgs/radicle.nix') diff --git a/pkgs/radicle.nix b/pkgs/radicle.nix new file mode 100644 index 0000000..ff65ecc --- /dev/null +++ b/pkgs/radicle.nix @@ -0,0 +1,47 @@ +let + interface = { lib, buildNpmPackage, fetchgit, bash, config ? null, ...}: buildNpmPackage { + pname = "radicle-interface"; + version = "git"; + src = fetchgit { + url = "https://seed.radicle.xyz/z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git"; + rev = "288f55da7667d0678d4c1abc248da2cff54891e4"; + hash = "sha256-bdXsK01mLrz4g8rVlMQfZDB+p7ldMIsTJP7jfGeobkM="; + }; + + patches = [ ./radicle-remove-curl-script.patch ]; + postPatch = '' + patchShebangs scripts/* + ${if config == null then "" else '' + rm -f src/config.json + echo ${lib.escapeShellArg (builtins.toJSON config)} > src/config.json + ''} + ''; + makeCacheWritable = true; + + installPhase = '' + mkdir -p $out + cp -r build/* $out + ''; + + buildInputs = [ bash ]; + + npmDepsHash = "sha256-jqkkqLGojMfk75Chm/CG46ZE+VBAkXTGntwyj3l06jw="; + }; + + heartwood = { buildRustPackage, fetchgit }: buildRustPackage rec{ + pname = "heartwood"; + version = "git"; + src = fetchgit { + url = "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"; + rev = "499738de711ee96343163550f2e053bdba248c1a"; + hash = "sha256-CnpiNynCtGEBpqcUCnTBR6T900bICyDTIp32T6RNQdo="; + }; + cargoLock.lockFile = "${src}/Cargo.lock"; + cargoBuildFlags = [ "--all" ]; + # tests seem to be a little nondeterministic, and sometimes hang + doCheck = false; + }; +in +{ + inherit interface heartwood; +} -- cgit v1.2.3