From c31240ec37e9cbe968e8d966ebe7c3a45aa140e7 Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 27 Feb 2026 13:21:53 +0900 Subject: [PATCH] first --- build.zsh | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ cfg/aios.nspawn | 5 +++++ cfg/zshrc | 14 +++++++++++++ 3 files changed, 73 insertions(+) create mode 100755 build.zsh create mode 100644 cfg/aios.nspawn create mode 100644 cfg/zshrc diff --git a/build.zsh b/build.zsh new file mode 100755 index 0000000..b295aac --- /dev/null +++ b/build.zsh @@ -0,0 +1,54 @@ +#!/bin/zsh + +set -e + +ROOTFS="root.x86_64" +OUTPUT="aios.tar.gz" +BUILD_DATE=$(date +%Y.%m.%d) + +echo "=== aios build $BUILD_DATE ===" + +rm -rf $ROOTFS +rm -f $OUTPUT +mkdir -p $ROOTFS + +pacstrap -c $ROOTFS base + +echo 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch +Server = http://mirrors.cat.net/archlinux/$repo/os/$arch' > $ROOTFS/etc/pacman.d/mirrorlist +sed -i 's/CheckSpace/#CheckSpace/' $ROOTFS/etc/pacman.conf + +arch-chroot $ROOTFS /bin/sh -c 'pacman-key --init && pacman-key --populate archlinux' +arch-chroot $ROOTFS /bin/sh -c 'pacman -Syu --noconfirm base-devel vim git zsh rust openssh jq nodejs npm' +arch-chroot $ROOTFS /bin/sh -c 'npm i -g @anthropic-ai/claude-code' + +arch-chroot $ROOTFS /bin/sh -c 'useradd -m -G wheel -s /bin/zsh ai' +arch-chroot $ROOTFS /bin/sh -c 'echo "ai:ai" | chpasswd' +echo "ai ALL=(ALL:ALL) NOPASSWD: ALL" >> $ROOTFS/etc/sudoers + +mkdir -p $ROOTFS/etc/systemd/system/console-getty.service.d +cat > $ROOTFS/etc/systemd/system/console-getty.service.d/override.conf <<'EOF' +[Service] +ExecStart= +ExecStart=-/usr/bin/agetty --autologin ai --noclear --keep-baud console 115200,38400,9600 $TERM +EOF + +cp cfg/zshrc $ROOTFS/home/ai/.zshrc +arch-chroot $ROOTFS /bin/sh -c 'chown ai:ai /home/ai/.zshrc' + +cat > $ROOTFS/etc/os-release < $ROOTFS/etc/hostname + +tar czf $OUTPUT -C $ROOTFS . + +echo "=== build complete: $OUTPUT ===" diff --git a/cfg/aios.nspawn b/cfg/aios.nspawn new file mode 100644 index 0000000..33c00ea --- /dev/null +++ b/cfg/aios.nspawn @@ -0,0 +1,5 @@ +[Exec] +Boot=yes + +[Network] +Private=no diff --git a/cfg/zshrc b/cfg/zshrc new file mode 100644 index 0000000..231af85 --- /dev/null +++ b/cfg/zshrc @@ -0,0 +1,14 @@ +export EDITOR=vim +export LANG=en_US.UTF-8 +export PATH=$HOME/.local/bin:$PATH + +alias claude='claude --dangerously-skip-permissions' +alias c='claude --dangerously-skip-permissions' + +autoload -Uz promptinit && promptinit && prompt adam1 +autoload -Uz compinit && compinit + +HISTFILE=~/.zsh_history +HISTSIZE=10000 +SAVEHIST=10000 +setopt SHARE_HISTORY