Skip to content

Instantly share code, notes, and snippets.

@sploders101
Last active July 3, 2024 18:56
Show Gist options
  • Save sploders101/304913b33c00b3b324e2aa1473351ad6 to your computer and use it in GitHub Desktop.
Save sploders101/304913b33c00b3b324e2aa1473351ad6 to your computer and use it in GitHub Desktop.
Build script for helix which includes a variety of language servers
*
!.gitignore
!/hx-ai-build.sh
!/build.sh
!/Dockerfile
!/config.toml
#!/bin/bash
# docker build -t .
docker run --rm -v .:/build --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined -it legacy-builder /build/hx-ai-build.sh
theme = "onedark-skeys"
[editor]
scrolloff = 1
scroll-lines = 1
shell = ["bash", "-c"]
auto-format = false
# idle-timeout = 1000
color-modes = true
bufferline = "always"
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.lsp]
auto-signature-help = false
display-signature-help-docs = false
snippets = false
[editor.file-picker]
hidden = false
[editor.indent-guides]
render = true
character = "▏"
# [editor.explorer]
# column-width = 23
# style = "tree"
# position = "embed"
[keys.normal]
"A-]" = [":bc"]
"ret" = [":w"]
"minus" = ["goto_previous_buffer"]
"=" = ["goto_next_buffer"]
"C-f" = [":format"]
[keys.insert]
"A-p" = ["signature_help"]
FROM rockylinux:8.9
RUN dnf upgrade -y
RUN dnf groupinstall -y 'Development Tools'
RUN dnf install -y curl git wget fuse desktop-file-utils
RUN useradd -ms /bin/bash builder
USER 1000:1000
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
ENV PATH="/home/builder/.cargo/bin:${PATH}"
#!/bin/bash
cd "$(dirname "$0")"
MAIN_DIR="$(pwd)"
mkdir -p approot/{bin,lib,opt,usr/lib/helix}
# Install nodejs
NODE_VER='v20.14.0'
rm -rf "approot/node-$NODE_VER-linux-x64"
wget -O- "https://nodejs.org/dist/$NODE_VER/node-$NODE_VER-linux-x64.tar.xz" | tar -JxvC approot
# Install helix
if [[ ! -d helix-editor ]]; then
git clone https://github.com/sploders101/helix-editor || exit
fi
(
cd helix-editor/helix-term
git pull
cargo build --release || exit
cd ..
cp -r runtime ../approot/usr/lib/helix/runtime
cp -r ../config.toml ../approot/usr/lib/helix/config.toml
rm -rf ../approot/usr/lib/helix/runtime/grammars/sources
cp target/release/hx ../approot/bin/hx
cp contrib/Helix.desktop ../approot/Helix.desktop
cp contrib/helix.png ../approot/helix.png
)
(
echo '#!/bin/bash'
echo 'APPDIR="$(dirname "$(readlink -f "${0}")")"'
echo "HELIX_RUNTIME=\"\$APPDIR/usr/lib/helix/runtime\" PATH=\"\$APPDIR/bin:\$APPDIR/node-$NODE_VER-linux-x64/bin:\$PATH\" \"\$APPDIR/bin/hx\" -c \"\$APPDIR/usr/lib/helix/config.toml\" \"\$@\""
) > approot/AppRun
chmod +x approot/AppRun
export PATH="$(pwd)/approot/bin:$(pwd)/approot/node-$NODE_VER-linux-x64/bin:$PATH"
"./approot/node-$NODE_VER-linux-x64/bin/npm" i --prefix "./approot/node-$NODE_VER-linux-x64/" -g \
pyright vscode-langservers-extracted typescript typescript-language-server \
@vue/language-server yaml-language-server@next svelte-language-server \
dockerfile-language-server-nodejs @microsoft/compose-language-service bash-language-server \
@ansible/ansible-language-server perlnavigator-server intelephense awk-language-server emmet-ls
rm -r approot/node-$NODE_VER-linux-x64/include
if [[ ! -d rhai-lsp ]]; then
git clone https://github.com/rhaiscript/rhai-lsp.git rhai-lsp
fi
(
cd rhai-lsp
git pull
cargo build --release || exit
cp target/release/rhai ../approot/bin/rhai
)
if [[ ! -e appimagetool-x86_64.AppImage ]]; then
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
./appimagetool-x86_64.AppImage approot/ hx-ai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment