|
1 | 1 | {
|
2 | 2 | "cells": [
|
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "id": "e01fb3ac-9ab7-4723-8cbc-08434c9e158f", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "## Google Colab & Binder Rust Setup\n", |
| 9 | + "\n", |
| 10 | + "The following cell is used to set up a Rust environment on Colab and Binder. Don't execute it locally!\n", |
| 11 | + "\n", |
| 12 | + "Many thanks to [`mateusvmv`](https://github.com/mateusvmv) for this hack in [`gist.github.com/korakot/ae95315ea6a3a3b33ee26203998a59a3`](https://gist.github.com/korakot/ae95315ea6a3a3b33ee26203998a59a3?permalink_comment_id=4715636#gistcomment-4715636)." |
| 13 | + ] |
| 14 | + }, |
| 15 | + { |
| 16 | + "cell_type": "code", |
| 17 | + "execution_count": null, |
| 18 | + "id": "1d278011-f31a-4e13-890f-1ad8533396b8", |
| 19 | + "metadata": {}, |
| 20 | + "outputs": [], |
| 21 | + "source": [ |
| 22 | + "!rm -rf /root/.local/share/jupyter/kernels\n", |
| 23 | + "\n", |
| 24 | + "# Nix install\n", |
| 25 | + "!curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --init none --no-confirm\n", |
| 26 | + "!ln -s /root/.nix-profile/bin /opt/bin\n", |
| 27 | + "\n", |
| 28 | + "# Install evcxr\n", |
| 29 | + "!nix-env -f '<nixpkgs>' -iA cargo rustc evcxr sccache\n", |
| 30 | + "!evcxr_jupyter --install\n", |
| 31 | + "\n", |
| 32 | + "# Configure evcxr\n", |
| 33 | + "!mkdir -p /root/.config/evcxr\n", |
| 34 | + "!printf \":timing\\n:sccache 1\" > /root/.config/evcxr/init.evcxr\n", |
| 35 | + "\n", |
| 36 | + "# IPC Proxy (https://stackoverflow.com/a/74821762)\n", |
| 37 | + "!wget -qO- https://gist.github.com/SpencerPark/e2732061ad19c1afa4a33a58cb8f18a9/archive/b6cff2bf09b6832344e576ea1e4731f0fb3df10c.tar.gz | tar xvz --strip-components=1\n", |
| 38 | + "!python install_ipc_proxy_kernel.py --quiet --kernel=rust --implementation=ipc_proxy_kernel.py > /dev/null\n", |
| 39 | + "\n", |
| 40 | + "# To avoid confusion between kernel names\n", |
| 41 | + "!sed -i 's/\"display_name\": \"Rust\"/\"display_name\": \"Rust-TCP\"/g' /root/.local/share/jupyter/kernels/rust_tcp/kernel.json" |
| 42 | + ] |
| 43 | + }, |
3 | 44 | {
|
4 | 45 | "cell_type": "markdown",
|
5 | 46 | "id": "ac5c5759",
|
6 | 47 | "metadata": {},
|
7 | 48 | "source": [
|
8 |
| - "# Install Dependencies" |
| 49 | + "## Install Dependencies" |
9 | 50 | ]
|
10 | 51 | },
|
11 | 52 | {
|
|
0 commit comments