From 49e599eeba8bae1665f7d97b979ad3005287b246 Mon Sep 17 00:00:00 2001 From: Marvin Date: Sat, 9 May 2026 15:16:11 +0000 Subject: [PATCH] feat: add rust-pod development environment setup --- Containerfile | 14 ++++++++++++++ install-apk.sh | 33 +++++++++++++++++++++++++++++++++ install-cargo-tools.sh | 10 ++++++++++ install-rust.sh | 6 ++++++ rust-pod | 15 +++++++++++++++ setup-rust-dev.sh | 15 +++++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 Containerfile create mode 100755 install-apk.sh create mode 100755 install-cargo-tools.sh create mode 100755 install-rust.sh create mode 100755 rust-pod create mode 100755 setup-rust-dev.sh diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..4c1b94a --- /dev/null +++ b/Containerfile @@ -0,0 +1,14 @@ +FROM alpine:latest + +# Copy all installation scripts into the image +COPY install-apk.sh /usr/local/bin/ +COPY install-rust.sh /usr/local/bin/ +COPY install-cargo-tools.sh /usr/local/bin/ +COPY setup-rust-dev.sh /usr/local/bin/ + +# Make them executable and run the orchestrator +RUN chmod +x /usr/local/bin/*.sh && \ + /usr/local/bin/setup-rust-dev.sh + +# Set the default shell to fish (or bash) +CMD ["/usr/bin/fish"] diff --git a/install-apk.sh b/install-apk.sh new file mode 100755 index 0000000..46f97ce --- /dev/null +++ b/install-apk.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e +echo "Installing system dependencies via apk..." +apk add --no-cache \ + build-base \ + bash \ + curl \ + ca-certificates \ + git \ + git-delta \ + htop \ + i2c-tools \ + luarocks \ + man-pages \ + neovim \ + nushell \ + netcat-openbsd \ + ripgrep \ + starship \ + tig \ + tree-sitter \ + vim \ + wget \ + zoxide \ + bat \ + fd \ + exa \ + fish \ + rustup \ + musl-dev \ + openssl-dev \ + perl \ + linux-headers diff --git a/install-cargo-tools.sh b/install-cargo-tools.sh new file mode 100755 index 0000000..affc248 --- /dev/null +++ b/install-cargo-tools.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +echo "Installing cargo tools..." +# Use binstall for speed where possible +cargo binstall --no-confirm difftastic dust + +echo "Installing custom crates..." +cargo install --git https://git.nubo.sh/hulthe/wmutils.git +cargo install --git https://git.nubo.sh/hulthe/lockscreen-blur.git +cargo install --git https://git.nubo.sh/hulthe/volume_indicator.git diff --git a/install-rust.sh b/install-rust.sh new file mode 100755 index 0000000..fb86d80 --- /dev/null +++ b/install-rust.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +echo "Installing Rust toolchain..." +rustup default stable +curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash +cargo binstall --no-confirm cargo-watch cargo-get diff --git a/rust-pod b/rust-pod new file mode 100755 index 0000000..c1512b1 --- /dev/null +++ b/rust-pod @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +IMAGE_NAME="rust-dev-pod" + +if ! podman image exists $IMAGE_NAME; then + echo "Image $IMAGE_NAME not found. Building..." + podman build -t $IMAGE_NAME . +fi + +echo "Dropping you into the Rust Dev Pod..." +podman run -it --rm \ + -v "$PWD:$PWD" \ + -w "$PWD" \ + $IMAGE_NAME \ + bash diff --git a/setup-rust-dev.sh b/setup-rust-dev.sh new file mode 100755 index 0000000..fc4f115 --- /dev/null +++ b/setup-rust-dev.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +# Run the sub-scripts +/usr/local/bin/install-apk.sh +/usr/local/bin/install-rust.sh +/usr/local/bin/install-cargo-tools.sh + +echo "Setting up dotfiles..." +mkdir -p $HOME/.config/dotfiles +if [ ! -d "$HOME/.config/dotfiles/.git" ]; then + git clone https://git.nubo.sh/hulthe/df.git $HOME/.config/dotfiles +fi +cd $HOME/.config/dotfiles +bash manager/setup.sh