nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p curl jq gnused
3
4set -euo pipefail
5
6# e.g. linux-gecko-20220331-59d0a686993f-ffd8d6280276
7BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay.json | jq .buildId -r)
8REVISION=$(echo $BUILD_ID | sed 's/^.*-//')
9NODE_BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay-node.json | jq .buildId -r)
10
11REPLAY_DL=https://static.replay.io/downloads/${BUILD_ID}.tar.bz2
12LIB_DL=https://static.replay.io/downloads/linux-recordreplay-${REVISION}.tgz
13NODE_DL=https://static.replay.io/downloads/${NODE_BUILD_ID}
14
15
16cat >"${BASH_SOURCE%/*}/meta.json" <<EOF
17{
18 "replay": {
19 "url": "${REPLAY_DL}",
20 "sha256": "$(nix-prefetch-url --type sha256 "${REPLAY_DL}")"
21 },
22 "recordreplay": {
23 "url": "${LIB_DL}",
24 "sha256": "$(nix-prefetch-url --type sha256 --unpack "${LIB_DL}")",
25 "stripRoot": false
26 },
27 "replay-node": {
28 "url": "${NODE_DL}",
29 "sha256": "$(nix-prefetch-url --type sha256 "${NODE_DL}")"
30 }
31}
32EOF