Compare commits

...
9 Commits
Author SHA1 Message Date
fe5hua 99422bc415 dev container and git config 2026-10-09 06:19:05 +02:00
fe5hua 596b5873e6 made init hooks script idemptent 2026-09-15 06:24:20 +02:00
fe5hua 90e2952211 add libxkbcommon dev dependencies 2026-09-14 16:59:57 +02:00
fe5hua ae773438a3 add pkg-config to exports 2026-09-14 16:40:43 +02:00
fe5hua ca68c85c72 added dev dependencies for rust bevy 2026-09-14 16:11:40 +02:00
fe5hua 72c90d699e added dev dependencies and aseprite to dev container 2026-09-14 16:05:52 +02:00
fe5hua 492cb7efb2 proper home on fish enter 2026-09-14 09:58:56 +02:00
fe5hua d8cb355284 config alias 2026-09-14 09:56:15 +02:00
fe5hua de0d7c44fd flatpak aliases 2026-09-14 09:53:02 +02:00
4 changed files with 136 additions and 27 deletions
+6 -1
View File
@@ -17,6 +17,9 @@ set -gx SSH_AUTH_SOCK /home/user/.var/app/com.bitwarden.desktop/data/.bitwarden-
# alias # alias
alias vi='vim' alias vi='vim'
alias zed='flatpak run dev.zed.Zed'
alias bw='flatpak run --command=bw com.bitwarden.desktop'
alias config="zed ~/.local/share/chezmoi/"
# zoxide init # zoxide init
zoxide init fish | source zoxide init fish | source
@@ -25,4 +28,6 @@ zoxide init fish | source
starship init fish | source starship init fish | source
# proper home dir for atomic desktop # proper home dir for atomic desktop
cd ~ if test "$PWD" = "/var/home/$USER"
cd "$HOME"
end
+18 -1
View File
@@ -27,7 +27,24 @@ function dev
tldr \ tldr \
cheat \ cheat \
pv \ pv \
age age \
libcxx-devel \
ninja-build \
unzip \
libX11-devel \
libXcursor-devel \
libXi-devel \
libXrandr-devel \
mesa-libGL-devel \
fontconfig-devel \
alsa-lib-devel \
systemd-devel \
libxkbcommon \
libxkbcommon-devel \
libappindicator-gtk3-devel \
librsvg2-devel \
libxdo-devel \
nodejs24
if distrobox list --no-color | string match -q "*| $name *" if distrobox list --no-color | string match -q "*| $name *"
distrobox enter $name distrobox enter $name
+5
View File
@@ -0,0 +1,5 @@
[user]
name = fe5hua
email = git@fe5hua.de
[init]
defaultBranch = main
+107 -25
View File
@@ -4,12 +4,16 @@ set -euo pipefail
echo "Initializing development environment..." echo "Initializing development environment..."
export DEV_HOME="$HOME"
export DEV_USER="$(basename "$DEV_HOME")"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Rust directories # Software directories
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
mkdir -p /opt/rustup /opt/cargo mkdir -p /opt/rustup /opt/cargo /opt/aseprite /opt/dx /opt/npm-global
chown "$(id -u):$(id -g)" /opt/rustup /opt/cargo chown -R "$DEV_USER:$DEV_USER" /opt/rustup /opt/cargo /opt/aseprite /opt/dx /opt/npm-global
# TODO basically all commamd from here on need to run as $DEV_USER, but scrpt runs as root
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Fish configuration # Fish configuration
@@ -31,53 +35,126 @@ EOF
export RUSTUP_HOME=/opt/rustup export RUSTUP_HOME=/opt/rustup
export CARGO_HOME=/opt/cargo export CARGO_HOME=/opt/cargo
echo "Installing rustup..." if [[ ! -x /opt/cargo/bin/rustup ]]; then
echo "Installing rustup..."
curl \ curl \
--proto '=https' \ --proto '=https' \
--tlsv1.2 \ --tlsv1.2 \
-sSf \ -sSf \
https://sh.rustup.rs \ https://sh.rustup.rs \
| sh -s -- -y --no-modify-path | sh -s -- -y --no-modify-path
else
echo "rustup is already installed."
fi
# -----------------------------------------------------------------------------
# Rust toolchain # Rust toolchain
# -----------------------------------------------------------------------------
echo "Installing stable Rust toolchain..." echo "Installing stable Rust toolchain..."
/opt/cargo/bin/rustup default stable /opt/cargo/bin/rustup default nightly
# -----------------------------------------------------------------------------
# Fish completions # Fish completions
# -----------------------------------------------------------------------------
echo "Installing rustup Fish completion..." echo "Installing rustup Fish completion..."
/opt/cargo/bin/rustup completions fish \ /opt/cargo/bin/rustup completions fish \
| tee /etc/fish/completions/rustup.fish >/dev/null | tee /etc/fish/completions/rustup.fish >/dev/null
# Dioxus CLI
export DX_INSTALL=/opt/dx
if [[ ! -x /opt/cargo/bin/dx ]]; then
echo "Installing dioxus cli..."
# TODO needs to run as user, not root
curl -sSL https://dioxus.dev/install.sh | bash
else
echo "dioxus cli is already installed."
fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Export Rust development tools to the host # NodeJS and NPM
# -----------------------------------------------------------------------------
npm config set prefix '/opt/npm-global'
# -----------------------------------------------------------------------------
# Aseprite
# -----------------------------------------------------------------------------
if [[ -f /opt/aseprite/aseprite.desktop ]]; then
echo "Aseprite desktop entry already exists; skipping installation."
else
if [[ ! -d /opt/aseprite ]]; then
echo "Cloning Aseprite..."
git clone --recursive https://github.com/aseprite/aseprite.git /opt/aseprite
else
echo "Aseprite source already exists."
fi
cd /opt/aseprite
if [[ ! -x /opt/aseprite/build/bin/aseprite ]]; then
git submodule update --init --recursive
echo "Building Aseprite..."
./build.sh --auto --norun
else
echo "Aseprite is already built."
fi
echo "Creating Aseprite desktop entry..."
cat > /opt/aseprite/aseprite.desktop <<'EOF'
[Desktop Entry]
Name=Aseprite
Comment=Animated sprite editor
Exec=/opt/aseprite/build/bin/aseprite %F
Icon=/opt/aseprite/build/bin/data/icons/ase.ico
Terminal=false
Type=Application
Categories=Graphics;2DGraphics;
EOF
fi
if sudo -u "$DEV_USER" env HOME="$DEV_HOME" distrobox-export --list-apps 2>/dev/null |
grep -Fq "aseprite"
then
echo "Aseprite desktop entry is already exported."
else
echo "Exporting Aseprite desktop entry..."
sudo -u "$DEV_USER" env HOME="$DEV_HOME" distrobox-export --app /opt/aseprite/aseprite.desktop
fi
# -----------------------------------------------------------------------------
# Export development tools to the host
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
export PATH="/opt/cargo/bin:$PATH" export PATH="/opt/cargo/bin:$PATH"
echo "Exporting development tools..." echo "Exporting development tools..."
DEV_HOME="$HOME"
DEV_USER="$(basename "$DEV_HOME")"
export_bin() { export_bin() {
local binary="$1" local binary="$1"
if command -v "$binary" >/dev/null 2>&1; then if ! command -v "$binary" >/dev/null 2>&1; then
echo " warning: $binary not found"
elif sudo -u "$DEV_USER" env HOME="$DEV_HOME" \
distrobox-export \
--list-binaries \
--export-path "$DEV_HOME/.local/bin" 2>/dev/null |
awk -F'|' -v binary="$binary" '
{
name = $1
gsub(/^[[:space:]]+|[[:space:]]+$/, "", name)
if (name == binary) {
found = 1
}
}
END { exit !found }
'
then
echo " $binary is already exported."
else
echo " exporting $binary" echo " exporting $binary"
sudo -u "$DEV_USER" \ sudo -u "$DEV_USER" \
env HOME="$DEV_HOME" \ env HOME="$DEV_HOME" \
distrobox-export \ distrobox-export \
--bin "$(command -v "$binary")" \ --bin "$(command -v "$binary")" \
--export-path "$DEV_HOME/.local/bin" --export-path "$DEV_HOME/.local/bin"
else
echo " warning: $binary not found"
fi fi
} }
@@ -96,7 +173,10 @@ for binary in \
rust-gdb \ rust-gdb \
rust-gdbgui \ rust-gdbgui \
rust-lldb \ rust-lldb \
rustup rustup \
dx \
npm \
node
do do
export_bin "$binary" export_bin "$binary"
done done
@@ -105,6 +185,8 @@ done
export_bin clang export_bin clang
export_bin clang++ export_bin clang++
export_bin cmake export_bin cmake
export_bin pkg-config
export_bin ninja
export_bin lld export_bin lld
export_bin ld.lld export_bin ld.lld
export_bin gdb export_bin gdb