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:
@@ -1,14 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Claude Code and aigpt setup for aios
|
||||
# Installs aigpt, configures MCP, sets up shared memory
|
||||
# Claude Code MCP setup for aios
|
||||
# Configures MCP, sets up shared memory
|
||||
|
||||
ROOTFS="root.x86_64/var/lib/machines/arch"
|
||||
|
||||
echo "=== Claude & aigpt 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/'
|
||||
echo "=== Claude MCP Setup ==="
|
||||
|
||||
# Setup Claude Code MCP configuration (shared via symlink)
|
||||
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 '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
|
||||
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 '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 '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'
|
||||
echo "Setting up auto-login..."
|
||||
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /etc/systemd/system/getty@tty1.service.d'
|
||||
|
||||
Reference in New Issue
Block a user