Install the Helix editor on Fedora Silverblue

Published: 10.03.2023 | 321 Words | 2 minutes
Tags: [ container fedora silverblue ]

I recently installed a version of Fedora Silverblue. For me, the main selling point of Silverblue are the snapshots of my OS and the installed software I can rollback to if something breaks (I do break my system quite often…​).

To provide such features a lot of things in Silverblue are running as containers. I decided I want my favourite editor Helix also installed as a container, bundled with the LSP’s I use.

I created a Container and an alias for it in my shell. You can find the repo with the Dockerfile here: gitlab.fachschaften.org/togir2/helix-container

I am using zsh, here is a snippet from my .zshrc:

# ~/.zshrc
alias hx='podman run --rm -it \
        --volume "${HOME}:${HOME}:rslave" \
        --volume "/tmp:/tmp:rslave" \
        --env "HOME=${HOME}" \
		--env "COLORTERM=${COLORTERM}" \
        --workdir "$(pwd)" \
        --privileged \
        --security-opt label=disable \
        --entrypoint /app/hx \
        registry.gitlab.fachschaften.org/togir2/helix-container:95436375'

I can now use helix to edit all files which are mapped via one of the "--volume" argumets. In my config these are all files in my HOME folder and the files in the /tmp foldder.

If you want to use it would recommend you create your own container so that you can customize what you do need (my image is >2GB, you might not need all of that).

Here is a snapshot of the Dockerfile I used to build the container. Check out the git repo to get the newest version.

# Dockerfile
FROM registry.fedoraproject.org/fedora:38

WORKDIR /app
RUN dnf install -y nodejs npm python3 python3-pip xz julia openblas openblas-devel clang-tools-extra

RUN curl -L https://github.com/helix-editor/helix/releases/download/22.12/helix-22.12-x86_64-linux.tar.xz --output helix-x86_64-linux.tar.xz && \
    tar -xf helix-x86_64-linux.tar.xz && \
    mv helix*-x86_64-linux/* . && \
    rm helix*-x86_64-linux -rf

# Install language servers
RUN pip install cmake-language-server 'python-lsp-server[all]' && \
    npm install --no-dev -g \
      lldb-vscode \
      vls \
      typescript \
      typescript-language-server \
      intelephense \
      elm elm-test elm-format @elm-tooling/elm-language-server \
      vscode-langservers-extracted \
      dot-language-server \
      dockerfile-language-server-nodejs && \
    julia -e 'using Pkg; Pkg.add("LanguageServer")' # julia

ENV HELIX_RUNTIME=/app/runtime
CMD [ "/app/hx" ]
That's all ;)
Back to the top