Merge pull request #9 from syui/claude/aios-initial-direction-011CUrcij89bjpsbc7k8wQeo

Claude/aios initial direction 011 c urcij89bjpsbc7k8w qeo
This commit is contained in:
syui
2025-11-09 05:22:58 +09:00
committed by GitHub
3 changed files with 24 additions and 26 deletions

View File

@@ -63,9 +63,9 @@ arch-chroot root.x86_64 /bin/sh -c 'npm i -g @anthropic-ai/claude-code'
# Copy os-release # Copy os-release
cp -rf ./cfg/os-release root.x86_64/etc/os-release cp -rf ./cfg/os-release root.x86_64/etc/os-release
# Configure sudoers for wheel group # Configure sudoers for wheel group (full access for container operation)
echo "Configuring sudoers..." echo "Configuring sudoers..."
arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/pacstrap, /usr/bin/arch-chroot, /usr/bin/rm, /usr/bin/mkdir, /usr/bin/mv, /usr/bin/cp, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/machinectl, /usr/bin/systemd-nspawn, /usr/bin/mount, /usr/bin/chroot, /bin/bash" >> /etc/sudoers' arch-chroot root.x86_64 /bin/sh -c 'echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers'
# Install aigpt (aios core package) # Install aigpt (aios core package)
echo "Installing aigpt..." echo "Installing aigpt..."

View File

@@ -11,6 +11,17 @@ tar xf "$TARBALL"
mkdir -p /var/lib/machines mkdir -p /var/lib/machines
mv root.x86_64 /var/lib/machines/$NAME mv root.x86_64 /var/lib/machines/$NAME
# Create aios.nspawn for network access
echo "Creating network configuration..."
mkdir -p /etc/systemd/nspawn
cat > /etc/systemd/nspawn/$NAME.nspawn <<'EOF'
[Exec]
Boot=yes
[Network]
Private=no
EOF
echo "=== Installation complete ===" echo "=== Installation complete ==="
echo "" echo ""
echo "Usage:" echo "Usage:"

View File

@@ -61,37 +61,24 @@ cp -rf ./cfg/zshrc $ROOTFS/root/.zshrc
# Copy .zshrc for user 'ai' # Copy .zshrc for user 'ai'
cp -rf ./cfg/zshrc $ROOTFS/home/ai/.zshrc cp -rf ./cfg/zshrc $ROOTFS/home/ai/.zshrc
# Add claude auto-start on login (once, not exec) # Add workspace auto-entry and claude auto-start
cat >> $ROOTFS/home/ai/.zshrc <<'EOF' cat >> $ROOTFS/home/ai/.zshrc <<'EOF'
# Start claude on login (once) # aios: auto-enter workspace container
if [[ -o login ]] && [[ -o interactive ]]; then if [[ -o login ]] && [[ -o interactive ]]; then
if [[ -z "$INSIDE_WORKSPACE" ]]; then
# Enter workspace container
export INSIDE_WORKSPACE=1
exec sudo systemd-nspawn -q -D /var/lib/machines/workspace /bin/zsh
else
# Inside workspace - start claude with skip permissions
if command -v claude &>/dev/null; then if command -v claude &>/dev/null; then
claude claude --dangerously-skip-permissions
fi
fi fi
fi fi
EOF EOF
arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc' arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc'
# Copy aios startup script
cp -rf ./cfg/aios.zsh $ROOTFS/usr/local/bin/aios-startup
arch-chroot $ROOTFS /bin/sh -c 'chmod +x /usr/local/bin/aios-startup'
# Create default config directory and file for user 'ai'
arch-chroot $ROOTFS /bin/sh -c 'mkdir -p /home/ai/.config/syui/ai/os'
cat > $ROOTFS/home/ai/.config/syui/ai/os/config.json <<'EOF'
{
"shell": false
}
EOF
arch-chroot $ROOTFS /bin/sh -c 'chown -R ai:ai /home/ai/.config'
# Update .zshrc to source startup script
cat >> $ROOTFS/home/ai/.zshrc <<'EOF'
# aios startup
source /usr/local/bin/aios-startup
EOF
echo "✓ User setup complete" echo "✓ User setup complete"