summaryrefslogtreecommitdiff
path: root/pkgs/radicle.nix
diff options
context:
space:
mode:
authorstuebinm2023-10-12 01:02:42 +0200
committerstuebinm2023-10-12 01:02:42 +0200
commit1795ddbbe908360d051289e450eb2cf054b44dfc (patch)
tree3e4fbc8ebf8dfbce57d7ae6db6e424c307103529 /pkgs/radicle.nix
parent0bc531e9d6aa27d32210917a82263cc676d8ab41 (diff)
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.
Diffstat (limited to '')
-rw-r--r--pkgs/radicle.nix47
1 files changed, 47 insertions, 0 deletions
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;
+}