post install fixes
This commit is contained in:
parent
ac4740438b
commit
1323fdabe4
@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
BANNER=$(cat << "EOF"
|
BANNER=$(cat << "EOF"
|
||||||
:^7J5GB##&&##GPY?~:
|
:^7J5GB##&&##GPY?~:
|
||||||
^75B&@@@@@@&&&@@@@@@@#GJ~:
|
^75B&@@@@@@&&&@@@@@@@#GJ~:
|
||||||
@ -63,9 +65,15 @@ else
|
|||||||
TPM_ENABLED=true
|
TPM_ENABLED=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Install basic packages first
|
||||||
|
echo "[+] Installing basic packages..."
|
||||||
|
dnf install -y epel-release || exit 1
|
||||||
|
dnf config-manager --set-enabled crb || exit 1
|
||||||
|
dnf install -y zsh git wget curl || exit 1
|
||||||
|
|
||||||
# Create user and add SSH key
|
# Create user and add SSH key
|
||||||
echo "[+] Creating user ${ALMA_USER}..."
|
echo "[+] Creating user ${ALMA_USER}..."
|
||||||
useradd -m -G wheel -s /bin/zsh ${ALMA_USER}
|
useradd -m -G wheel -s /bin/zsh ${ALMA_USER} || exit 1
|
||||||
mkdir -p /home/${ALMA_USER}/.ssh
|
mkdir -p /home/${ALMA_USER}/.ssh
|
||||||
echo "${SSH_KEY}" > /home/${ALMA_USER}/.ssh/authorized_keys
|
echo "${SSH_KEY}" > /home/${ALMA_USER}/.ssh/authorized_keys
|
||||||
chmod 700 /home/${ALMA_USER}/.ssh
|
chmod 700 /home/${ALMA_USER}/.ssh
|
||||||
@ -74,20 +82,13 @@ chown -R ${ALMA_USER}:${ALMA_USER} /home/${ALMA_USER}/.ssh
|
|||||||
|
|
||||||
# Install oh-my-zsh and powerlevel10k
|
# Install oh-my-zsh and powerlevel10k
|
||||||
echo "[+] Installing oh-my-zsh and powerlevel10k..."
|
echo "[+] Installing oh-my-zsh and powerlevel10k..."
|
||||||
# Run oh-my-zsh installer as the user
|
# Download and run oh-my-zsh installer as the user
|
||||||
sudo -u ${ALMA_USER} bash -c 'sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended'
|
su - ${ALMA_USER} -c 'sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended' || echo "WARNING: oh-my-zsh installation failed"
|
||||||
# Clone powerlevel10k theme
|
# Clone powerlevel10k theme
|
||||||
sudo -u ${ALMA_USER} git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/${ALMA_USER}/.oh-my-zsh/custom/themes/powerlevel10k
|
su - ${ALMA_USER} -c 'git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k' || echo "WARNING: powerlevel10k installation failed"
|
||||||
|
|
||||||
# Install dotfiles
|
# Note: Dotfiles need to be copied manually after installation
|
||||||
echo "[+] Setting up dotfiles..."
|
echo "[!] Dotfiles will need to be configured manually after first boot"
|
||||||
if [ -d /tmp/nullpoint/dotfiles ]; then
|
|
||||||
echo "[+] Installing dotfiles from repository..."
|
|
||||||
cp /tmp/nullpoint/dotfiles/.* /home/${ALMA_USER}/ 2>/dev/null || true
|
|
||||||
chown -R ${ALMA_USER}:${ALMA_USER} /home/${ALMA_USER}/
|
|
||||||
else
|
|
||||||
echo "[!] No dotfiles directory found, user will need to configure manually"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set up MOTD
|
# Set up MOTD
|
||||||
if [ "$ENABLE_MOTD" = true ]; then
|
if [ "$ENABLE_MOTD" = true ]; then
|
||||||
@ -99,27 +100,29 @@ fi
|
|||||||
|
|
||||||
# Install additional packages
|
# Install additional packages
|
||||||
echo "[+] Installing additional packages..."
|
echo "[+] Installing additional packages..."
|
||||||
dnf install -y epel-release
|
|
||||||
dnf config-manager --set-enabled crb
|
|
||||||
dnf install -y \
|
dnf install -y \
|
||||||
clevis clevis-luks clevis-tang clevis-tpm2 tpm2-tools tpm2-tss \
|
clevis clevis-luks clevis-tang clevis-tpm2 tpm2-tools tpm2-tss \
|
||||||
git zsh tmux neovim python3-pip \
|
tmux neovim python3-pip \
|
||||||
dracut-clevis dracut-network \
|
dracut-clevis dracut-network \
|
||||||
dropbear tree curl wget nano
|
dropbear tree nano || exit 1
|
||||||
|
|
||||||
# Install lsd and bat from GitHub releases (not in repos)
|
# Install lsd and bat
|
||||||
echo "[+] Installing lsd and bat..."
|
echo "[+] Installing lsd and bat..."
|
||||||
# Get latest lsd version
|
# Install using fixed versions that should work
|
||||||
LSD_VERSION=$(curl -s https://api.github.com/repos/lsd-rs/lsd/releases/latest | grep -Po '"tag_name": "v\K[0-9.]+')
|
LSD_VERSION="1.0.0"
|
||||||
curl -sL "https://github.com/lsd-rs/lsd/releases/download/v${LSD_VERSION}/lsd-v${LSD_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz -C /tmp
|
BAT_VERSION="0.24.0"
|
||||||
mv /tmp/lsd-*/lsd /usr/local/bin/
|
|
||||||
chmod +x /usr/local/bin/lsd
|
|
||||||
|
|
||||||
# Get latest bat version
|
# Download and install lsd
|
||||||
BAT_VERSION=$(curl -s https://api.github.com/repos/sharkdp/bat/releases/latest | grep -Po '"tag_name": "v\K[0-9.]+')
|
if curl -sL "https://github.com/lsd-rs/lsd/releases/download/v${LSD_VERSION}/lsd-v${LSD_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz -C /tmp; then
|
||||||
curl -sL "https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/bat-v${BAT_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz -C /tmp
|
mv /tmp/lsd-*/lsd /usr/local/bin/ 2>/dev/null || true
|
||||||
mv /tmp/bat-*/bat /usr/local/bin/
|
chmod +x /usr/local/bin/lsd 2>/dev/null || true
|
||||||
chmod +x /usr/local/bin/bat
|
fi
|
||||||
|
|
||||||
|
# Download and install bat
|
||||||
|
if curl -sL "https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/bat-v${BAT_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz -C /tmp; then
|
||||||
|
mv /tmp/bat-*/bat /usr/local/bin/ 2>/dev/null || true
|
||||||
|
chmod +x /usr/local/bin/bat 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
# Create batman script for fancy man pages
|
# Create batman script for fancy man pages
|
||||||
cat > /usr/local/bin/batman << 'BATMAN'
|
cat > /usr/local/bin/batman << 'BATMAN'
|
||||||
|
Loading…
Reference in New Issue
Block a user