Compare commits
7
Commits
d8cb355284
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99422bc415 | ||
|
|
596b5873e6 | ||
|
|
90e2952211 | ||
|
|
ae773438a3 | ||
|
|
ca68c85c72 | ||
|
|
72c90d699e | ||
|
|
492cb7efb2 |
@@ -28,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[user]
|
||||||
|
name = fe5hua
|
||||||
|
email = git@fe5hua.de
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user