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/overlay.nix | 9 ++++--- pkgs/radicle-remove-curl-script.patch | 23 +++++++++++++++++ pkgs/radicle.nix | 47 +++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 pkgs/radicle-remove-curl-script.patch create mode 100644 pkgs/radicle.nix (limited to 'pkgs') diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 7dc036e..59905f9 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -9,6 +9,7 @@ let cargo = self.rust-bin.stable.latest.minimal; rustc = self.rust-bin.stable.latest.minimal; }; + radicle = import ./radicle.nix; in { galmon-core = self.callPackage (import ./galmon.nix {}) {}; @@ -70,9 +71,7 @@ in version = "git"; src = inputs.isabelle-utils; cargoLock.lockFile = "${src}/Cargo.lock"; - checkPhase = " - echo skipping tests - "; + doCheck = false; }; isabat = import "${inputs.isabelle-utils}/isabat.nix" { @@ -114,4 +113,8 @@ in [ "PREFIX=$(out)" "WITH_POSIX_C_SOURCE=YES" "WITH_GAMMACONTROL=YES" "WITH_LAYERSHELL=YES" "WITH_SCREENCOPY=YES" ]; })).override { wlroots = unstable.wlroots_0_16; stdenv = self.clangStdenv; }; + + heartwood = self.callPackage radicle.heartwood { inherit (rustPlatform) buildRustPackage; }; + + radicle-interface = self.callPackage radicle.interface {}; } diff --git a/pkgs/radicle-remove-curl-script.patch b/pkgs/radicle-remove-curl-script.patch new file mode 100644 index 0000000..ea8905d --- /dev/null +++ b/pkgs/radicle-remove-curl-script.patch @@ -0,0 +1,23 @@ +From 5e1c17c4b14925ec3c0610e8557a19215ac8eb4e Mon Sep 17 00:00:00 2001 +From: stuebinm +Date: Wed, 11 Oct 2023 17:11:30 +0200 +Subject: [PATCH] remove curl invocation + +--- + scripts/install-twemoji-assets | 4 +--- + 3 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/scripts/install-twemoji-assets b/scripts/install-twemoji-assets +index 741a02e..6990ba5 100755 +--- a/scripts/install-twemoji-assets ++++ b/scripts/install-twemoji-assets +@@ -1,6 +1,4 @@ + version="$(node -e 'console.log(require("twemoji/package.json").version)')" + + echo "Installing Twemoji SVG assets v${version}" + +-curl -sSL "https://github.com/twitter/twemoji/archive/refs/tags/v${version}.tar.gz" \ +- | tar -x -z -C public/twemoji/ --strip-components=3 "twemoji-${version}/assets/svg" +-- +2.40.1 + 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