refactor: Move core aios packages to build.zsh
Moved essential aios components to build.zsh (base layer): - sudoers configuration (wheel group permissions) - aigpt install (aios core package) - aibot install (aios core package) - renamed from 'ai' to 'aibot' Updated module responsibilities: - build.zsh: Arch base + aios core packages (required) - setup-user.sh: User customization only - setup-claude.sh: Claude MCP configuration only Benefits: - Clear separation: base vs customization - aigpt/aibot always included (core aios functionality) - Modules can be optionally skipped for customization
This commit is contained in:
12
build.zsh
12
build.zsh
@@ -60,6 +60,18 @@ arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'npm i -g @anthropic-ai
|
|||||||
# Copy os-release
|
# Copy os-release
|
||||||
cp -rf ./cfg/os-release root.x86_64/var/lib/machines/arch/etc/os-release
|
cp -rf ./cfg/os-release root.x86_64/var/lib/machines/arch/etc/os-release
|
||||||
|
|
||||||
|
# Configure sudoers for wheel group
|
||||||
|
echo "Configuring sudoers..."
|
||||||
|
arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman -Syu --noconfirm, /usr/bin/rm -rf /var/lib/pacman/db.lck, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl" >> /etc/sudoers'
|
||||||
|
|
||||||
|
# Install aigpt (aios core package)
|
||||||
|
echo "Installing aigpt..."
|
||||||
|
arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'git clone https://git.syui.ai/ai/gpt && cd gpt && cargo build --release && cp -rf ./target/release/aigpt /bin/'
|
||||||
|
|
||||||
|
# Install aibot (aios core package)
|
||||||
|
echo "Installing aibot..."
|
||||||
|
arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/aibot /bin/ && aibot ai'
|
||||||
|
|
||||||
echo "✓ Arch Linux base complete"
|
echo "✓ Arch Linux base complete"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Claude Code and aigpt setup for aios
|
# Claude Code MCP setup for aios
|
||||||
# Installs aigpt, configures MCP, sets up shared memory
|
# Configures MCP, sets up shared memory
|
||||||
|
|
||||||
ROOTFS="root.x86_64/var/lib/machines/arch"
|
ROOTFS="root.x86_64/var/lib/machines/arch"
|
||||||
|
|
||||||
echo "=== Claude & aigpt Setup ==="
|
echo "=== Claude MCP Setup ==="
|
||||||
|
|
||||||
# Install aigpt (AI memory system)
|
|
||||||
echo "Installing aigpt..."
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'git clone https://git.syui.ai/ai/gpt && cd gpt && cargo build --release && cp -rf ./target/release/aigpt /bin/'
|
|
||||||
|
|
||||||
# Setup Claude Code MCP configuration (shared via symlink)
|
# Setup Claude Code MCP configuration (shared via symlink)
|
||||||
echo "Configuring MCP..."
|
echo "Configuring MCP..."
|
||||||
@@ -34,10 +30,6 @@ arch-chroot $ROOTFS /bin/sh -c 'cp /root/.config/syui/ai/claude/claude_desktop_c
|
|||||||
arch-chroot $ROOTFS /bin/sh -c 'ln -sf /home/ai/.config/syui/ai/claude /home/ai/.config/claude'
|
arch-chroot $ROOTFS /bin/sh -c 'ln -sf /home/ai/.config/syui/ai/claude /home/ai/.config/claude'
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config/syui'
|
arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config/syui'
|
||||||
|
|
||||||
# Install ai/bot (optional, for backward compatibility)
|
|
||||||
echo "Installing ai/bot..."
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'git clone https://git.syui.ai/ai/bot && cd bot && cargo build && cp -rf ./target/debug/ai /bin/ && ai ai'
|
|
||||||
|
|
||||||
# Create config directory
|
# Create config directory
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /root/.config/syui/ai/gpt'
|
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /root/.config/syui/ai/gpt'
|
||||||
|
|
||||||
@@ -53,4 +45,4 @@ sleep 2
|
|||||||
arch-chroot $ROOTFS /bin/sh -c 'pkill aigpt'
|
arch-chroot $ROOTFS /bin/sh -c 'pkill aigpt'
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'if command -v sqlite3 &>/dev/null; then sqlite3 /root/.config/syui/ai/gpt/memory.db "PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;"; fi'
|
arch-chroot $ROOTFS /bin/sh -c 'if command -v sqlite3 &>/dev/null; then sqlite3 /root/.config/syui/ai/gpt/memory.db "PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL;"; fi'
|
||||||
|
|
||||||
echo "✓ Claude & aigpt setup complete"
|
echo "✓ Claude MCP setup complete"
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ echo "Creating user 'ai'..."
|
|||||||
arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai'
|
arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai'
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'echo "ai:root" | chpasswd'
|
arch-chroot $ROOTFS /bin/sh -c 'echo "ai:root" | chpasswd'
|
||||||
|
|
||||||
# Enable wheel group for sudo (specific commands without password)
|
|
||||||
echo "Configuring sudoers..."
|
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman -Syu --noconfirm, /usr/bin/rm -rf /var/lib/pacman/db.lck, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl" >> /etc/sudoers'
|
|
||||||
|
|
||||||
# Setup auto-login for user 'ai'
|
# Setup auto-login for user 'ai'
|
||||||
echo "Setting up auto-login..."
|
echo "Setting up auto-login..."
|
||||||
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /etc/systemd/system/getty@tty1.service.d'
|
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /etc/systemd/system/getty@tty1.service.d'
|
||||||
|
|||||||
Reference in New Issue
Block a user