Installing Helix on a Chromebook
Published: 2024-02-27 9:33 PM
Category: Technology | Tags: code, editor, ide, install, build, chromeos
Update November 2024
The post below details how to build Helix from source. This doesn't really provide much of a benefit other than being able to install from a specific branch of the project or a specific build from an open PR.
I've updated the bottom of the post with how to install Helix from the pre-built binaries. This takes much less disk space because you don't have to install the entire Rust toolchain to build the editor. The binary runs at about 13MB, so is much friendlier for the humble Chromebook.
I'm setting up another Chromebook and I realized I never documented the entire process of building Helix for a Chromebook. There are a couple extra steps needed to get everything wired up correctly.
The ChromeOS Linux container is Debian, but Helix doesn't have an apt
package for an easy install, so the best options are to either download and install the binaries or build from source. The GitHub repo has compiled source binaries for many systems. aarch64 builds should run on an ARM Chromebook, but I haven't tried it myself. This will walk through building from source.
Install from source
Chromebooks don't come with a C compiler toolchain, so you need to install the gcc
package:
sudo apt install build-essential
Now, you can install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Once the tooling is in place, make sure the /usr/src
directory is writable. It's owned by root
initially, so either reset the ownership or adjust the group who can write. This is where you can download the Helix git repository source files.
Clone the Helix repo into your directory of choice:
git clone https://github.com/helix-editor/helix
cd helix
Once you have the source downloaded, you can use cargo
to build Helix. Make sure you're in the helix
directory you just downloaded:
cargo install --path helix-term --locked
This will take a while, so grab a book. All of the dependencies are downloaded and then the compiler will build the Helix tooling and command line utilities. When you're finished, you'll have the hx
command available in your terminal to launch the editor.
The last thing to do is set up a symlink to the runtime directory:
ln -Ts $PWD/runtime ~/.config/helix/runtime
From there, you can set up your config.toml and languages.toml files in the config
directory. If you're on a Chromebook, you'll need to override the truecolor check to use themes.
Install from pre-built binary
The Helix team releases pre-built binaries for each release. You can get those from the releases page on the repo. You'll need to make sure you download the binary for the correct architecture. Most likely you'll need the *-x86_64_linux.tar.gz
file.
Once it's downloaded, you'll need to move it to your Linux container. If you're running the Linux development container, you'll need to make sure your Downloads folder is shared. You can also use the ChromeOS file manager to move the folder around.
Unzip the file and move the hx
file into your Linux system somewhere. Mine lives at ~/.cargo/bin/hx
, but it can just as easily be under /usr/bin
or /usr/local/bin
. It just needs to be accessible on your PATH
variable. Once you've got your file stored somewhere, you'll need to make it executable with chmod +x hx
.
Finally, you'll need to move the runtime/
directory. Copy it into a config directory. The installation documents suggest ~/.config/helix/runtime
which is what I do. I also keep my languages.toml
and config.toml
files here.
Comments