From 69754d9df09667638d1cdc838eed828b40f4f02c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Nov 2025 15:18:04 +0000 Subject: [PATCH] feat: Add default user 'ai' with auto-login Added user setup: - Username: ai - Password: root - Shell: zsh - Groups: wheel (sudo enabled) Auto-login configuration: - getty@tty1 with --autologin ai - .zshrc copied for both root and ai user This provides a ready-to-use environment with AI-first user. --- build.zsh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/build.zsh b/build.zsh index 4114da9..00980ee 100755 --- a/build.zsh +++ b/build.zsh @@ -25,9 +25,28 @@ arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'npm i -g @anthropic-ai # Copy os-release cp -rf ./cfg/os-release root.x86_64/var/lib/machines/arch/etc/os-release -# Copy .zshrc +# Create default user 'ai' +arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai' +arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'echo "ai:root" | chpasswd' + +# Enable wheel group for sudo +arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'sed -i "s/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/" /etc/sudoers' + +# Setup auto-login for user 'ai' +arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'mkdir -p /etc/systemd/system/getty@tty1.service.d' +cat > root.x86_64/var/lib/machines/arch/etc/systemd/system/getty@tty1.service.d/override.conf <<'EOF' +[Service] +ExecStart= +ExecStart=-/usr/bin/agetty --autologin ai --noclear %I $TERM +EOF + +# Copy .zshrc for root cp -rf ./cfg/zshrc root.x86_64/var/lib/machines/arch/root/.zshrc +# Copy .zshrc for user 'ai' +cp -rf ./cfg/zshrc root.x86_64/var/lib/machines/arch/home/ai/.zshrc +arch-chroot root.x86_64/var/lib/machines/arch /bin/sh -c 'chown ai:ai /home/ai/.zshrc' + # Install aigpt (AI memory system) 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/'