From 93c603e4173daf1b696373a71ea2ebeeae84f667 Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 27 Feb 2026 13:46:31 +0900 Subject: [PATCH] add pkg --- build.zsh | 4 +++- cfg/pkg.sh | 13 +++++++++++++ cfg/zshrc | 21 +++++++++++++++------ 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100755 cfg/pkg.sh diff --git a/build.zsh b/build.zsh index b295aac..6980713 100755 --- a/build.zsh +++ b/build.zsh @@ -19,9 +19,11 @@ Server = http://mirrors.cat.net/archlinux/$repo/os/$arch' > $ROOTFS/etc/pacman.d 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 'pacman -Syu --noconfirm base-devel vim git zsh rust openssh jq nodejs npm zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search' arch-chroot $ROOTFS /bin/sh -c 'npm i -g @anthropic-ai/claude-code' +bash cfg/pkg.sh $ROOTFS + 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 diff --git a/cfg/pkg.sh b/cfg/pkg.sh new file mode 100755 index 0000000..90b3b52 --- /dev/null +++ b/cfg/pkg.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +ROOTFS="$1" + +arch-chroot $ROOTFS /bin/sh -c ' +cd /tmp +git clone https://git.syui.ai/ai/gpt && cd gpt && cargo build --release && cp target/release/aigpt /usr/local/bin/ && cd .. +git clone https://git.syui.ai/ai/log && cd log && cargo build --release && cp target/release/ailog /usr/local/bin/ && cd .. +git clone https://git.syui.ai/ai/shell && cd shell && cargo build --release && cp target/release/aishell /usr/local/bin/ && cd .. +rm -rf gpt log shell +' diff --git a/cfg/zshrc b/cfg/zshrc index 231af85..ac6804e 100644 --- a/cfg/zshrc +++ b/cfg/zshrc @@ -1,14 +1,23 @@ -export EDITOR=vim -export LANG=en_US.UTF-8 -export PATH=$HOME/.local/bin:$PATH +export PATH=$HOME/.cargo/bin:$PATH +alias u="sudo pacman -Syu --noconfirm" +alias zs="vim ~/.zshrc" +alias zr="exec $SHELL && source ~/.zshrc" alias claude='claude --dangerously-skip-permissions' alias c='claude --dangerously-skip-permissions' -autoload -Uz promptinit && promptinit && prompt adam1 -autoload -Uz compinit && compinit +autoload -Uz compinit +compinit +fpath=(/usr/share/zsh/site-functions $fpath) + +#source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh -HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 +HISTFILE=~/.zsh_history setopt SHARE_HISTORY +setopt HIST_IGNORE_DUPS +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down