Skip to content

Commit

Permalink
Merge pull request #3 from ymm10ak1/feature-#2
Browse files Browse the repository at this point in the history
update: cliツールのいくつかをaquaで管理するように変更 #2
  • Loading branch information
ymm10ak1 authored Aug 11, 2024
2 parents 94bfca9 + 8a83768 commit d1e4ccc
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 52 deletions.
20 changes: 20 additions & 0 deletions .config/aqua/aqua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# aqua - Declarative CLI Version Manager
# https://aquaproj.github.io/
# checksum:
# enabled: true
# require_checksum: true
# supported_envs:
# - all
registries:
- type: standard
ref: v4.212.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: eza-community/eza@v0.19.0
- name: junegunn/fzf@v0.54.3
- name: ajeetdsouza/zoxide@v0.9.4
- name: starship/starship@v1.20.1
- name: denoland/deno@v1.45.5
- name: BurntSushi/ripgrep@14.1.0
- name: sharkdp/bat@v0.24.0
- name: sharkdp/fd@v10.1.0
2 changes: 0 additions & 2 deletions .config/nvim/lua/plugins/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ return {
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.textlint,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.clang_format.with({
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
!/.config/sheldon/**
!/.config/mise/
!/.config/mise/**
!/.config/aqua/
!/.config/aqua/**
!/scripts/
!/scripts/**
!/.vimrc
Expand Down
12 changes: 7 additions & 5 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# gpg
export GPG_TTY=$(tty)

# aqua
export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
export AQUA_GLOBAL_CONFIG="${AQUA_GLOBAL_CONFIG:-}:${XDG_CONFIG_HOME:-$HOME/.config}/aqua/aqua.yaml"
export AQUA_PROGRESS_BAR=true

# 言語を日本語にする
export LANG=ja_JP.UTF-8

Expand Down Expand Up @@ -60,8 +65,8 @@ export BAT_THEME="OneHalfDark"
export BAT_PAGER="less -RF"

# deno
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
# export DENO_INSTALL="$HOME/.deno"
# export PATH="$DENO_INSTALL/bin:$PATH"

# starship
eval "$(starship init zsh)"
Expand All @@ -70,9 +75,6 @@ eval "$(starship init zsh)"
# "--cmd cd"はzをcdコマンドに置き換える
eval "$(zoxide init --cmd cd zsh)"

# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# .zshrc_localがあれば読み込み
[ -f ~/.zshrc.local ] && source ~/.zshrc.local

Expand Down
12 changes: 11 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ create_symlink_config() {
local backup_config_dir="$HOME/.dotbackup/$BACKUP_DATE/.config"
if [[ "$HOME" != "$config_dir" ]]; then
for file in "$config_dir"/??*; do
# ディレクトリか通常のファイルの場合にシンボリックリンクを作る
# ディレクトリまたは通常のファイルの場合はシンボリックリンクを作る
if [[ -d "$file" || -f "$file" ]]; then
[[ $(basename "$file") = ".git" ]] && continue
# wsl2の場合はweztermのシンボリックリンクは作らない
Expand All @@ -72,6 +72,16 @@ create_symlink_config() {
fi
}

# aqua_pkg_install(){
# command echo -e "\033[1;36mInstalling aqua packages...\033[0m"
# aqua i -l -a
# }
#
# mise_pkg_install(){
# command echo -e "\033[1;36mInstalling mise packages...\033[0m"
# mise i
# }

run_script() {
if [[ -f "$1" ]]; then
source "$1"
Expand Down
57 changes: 13 additions & 44 deletions scripts/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

INSTALL_LIST=(git curl build-essential xsel bat ripgrep unzip zsh sqlite3 libsqlite3-dev zip wget)
INSTALL_LIST=(git curl build-essential xsel unzip zsh sqlite3 libsqlite3-dev zip wget)

has() {
type -p "$1" >/dev/null 2>&1
Expand All @@ -18,12 +18,8 @@ packages_install() {
# 必要なソフトウェアのインストール
for pkg in "${INSTALL_LIST[@]}"; do
local pkg_name="$pkg"
if [[ "$pkg" = "ripgrep" ]]; then
pkg_name="rg"
elif [[ "$pkg" = "build-essential" ]]; then
if [[ "$pkg" = "build-essential" ]]; then
pkg_name="gcc"
elif [[ "$pkg" = "bat" ]]; then
pkg_name="batcat"
fi
if ! (has "$pkg_name"); then
sudo apt-get install -y "$pkg"
Expand All @@ -32,43 +28,25 @@ packages_install() {
fi
done

#denoのインストール
if ! (has "deno"); then
echo "Install deno"
curl -fsSL https://deno.land/install.sh | sh
# aquaのインストール
if ! (has "aqua"); then
echo "Install aqua"
curl -sSfL -O https://raw.githubusercontent.com/aquaproj/aqua-installer/v3.0.1/aqua-installer
echo "fb4b3b7d026e5aba1fc478c268e8fbd653e01404c8a8c6284fdba88ae62eda6a aqua-installer" | sha256sum -c
chmod +x aqua-installer
./aqua-installer
else
echo "deno is already installed"
fi
# fzfのインストール(aptだとバージョンが古いのでgitを使う)
if ! (has "fzf"); then
echo "Install fzf"
local fzf_dir="$HOME/.fzf"
git clone --depth 1 https://github.com/junegunn/fzf.git "$fzf_dir"
"$fzf_dir"/install
else
echo "fzf is already installed"
fi
# zoxideのインストール
if ! (has "zoxide"); then
echo "Install zoxide"
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
else
echo "zoxide is already installed"
fi
# starshipのインストール
if ! (has "starship"); then
echo "Install starship"
curl -sS https://starship.rs/install.sh | sh -s -- -y
else
echo "starship is already installed"
echo "aqua is already installed"
fi

# rustのインストール
if ! (has "rustup"); then
echo "Install rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
echo "rust is already installed"
fi

# sheldonのインストール
if ! (has "sheldon"); then
echo "Install sheldon"
Expand All @@ -77,6 +55,7 @@ packages_install() {
else
echo "sheldon is already installed"
fi

# miseのインストール
if ! (has "mise"); then
echo "Install mise"
Expand All @@ -85,16 +64,6 @@ packages_install() {
else
echo "mise is already installed"
fi
# ezaのインストール
if ! (has "eza"); then
echo "Install eza"
wget -c https://github.com/eza-community/eza/releases/latest/download/eza_x86_64-unknown-linux-gnu.tar.gz -O - | tar xz
sudo chmod +x eza
sudo chown root:root eza
sudo mv eza /usr/local/bin/eza
else
echo "eza is already installed"
fi

# シェルをbashからzshに変更
if [[ "$SHELL" =~ "bash" ]]; then
Expand Down

0 comments on commit d1e4ccc

Please sign in to comment.