Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
122 changes: 122 additions & 0 deletions .config/mise/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
redactions = ["MISE_GITHUB_TOKEN"]

[settings]
color_theme = "catppuccin"
install_before = "7d"

[bootstrap.packages]
"apt:build-essential" = "latest"
"apt:git" = "latest"
"apt:gnupg" = "latest"
"apt:tar" = "latest"

[settings.dotfiles]
root = "~/.dotfiles"
default_mode = "symlink"

[bootstrap.hooks.pre-dotfiles]
run = """
mkdir -p -m 700 ~/.ssh
mkdir -p ~/{bin,ghe,github,github_hpeprod,work,docker,namespace}
mkdir -p ~/ghe/{hpe,yoshio-sugiyama}
mkdir -p ~/github/{HPE-TA,IMOKURI,others}
mkdir -p ~/github_hpeprod/yoshio-sugiyama_hpeprod
"""

[dotfiles]
"~/.vimrc" = {}
"~/.config/*" = {}

[bootstrap.repos]
"~/src/bashmarks" = { url = "https://github.com/huyng/bashmarks.git" }
"~/src/cat-bat" = { url = "https://github.com/catppuccin/bat.git" }

[tasks.bootstrap]
depends = ["bashrc", "mise-token", "ssh", "bashmarks", "bat-themes"]
run = """
echo "Bootstrap tasks completed."
"""

[tasks.bashrc]
run = """
#!/usr/bin/env bash
if ! grep -q '.config/bashrc' "${HOME}/.bashrc"; then echo -e "\nif [[ -f ~/.config/bashrc ]]; then\n . ~/.config/bashrc\nfi" >> "${HOME}/.bashrc"; fi
"""

[tasks.mise-token]
run = """
#!/usr/bin/env bash
if ! grep -q 'export MISE_GITHUB_TOKEN=' "${HOME}/.bashrc"; then echo 'export MISE_GITHUB_TOKEN="{{env.MISE_GITHUB_TOKEN}}"' >> "${HOME}/.bashrc"; fi
"""

[tasks.ssh]
run = """
#!/usr/bin/env bash
touch ~/.ssh/config
if ! grep -q 'Include ~/.config/ssh/' "${HOME}/.ssh/config"; then echo -e "\nInclude ~/.config/ssh/*.conf" >> "${HOME}/.ssh/config"; fi
"""

[tasks.bashmarks]
run = """
cd ~/src/bashmarks && make install
sed -i 's/^alias l=/# &/' ${HOME}/.bashrc
"""

[tasks.bat-themes]
run = """
mkdir -p "$(bat --config-dir)/themes"
cp -f ~/src/cat-bat/themes/*.tmTheme "$(bat --config-dir)/themes"
bat cache --build
"""

[settings.npm]
package_manager = "bun"

[tools]
bat = "latest"
bun = "latest"
fd = "latest"
fzf = "latest"
git-lfs = "latest"
github-cli = "latest"
helm = "latest"
helmfile = "latest"
jq = "latest"
kubectl = "latest"
lazygit = "latest"
lua-language-server = "latest"
neovim = "latest"
node = "lts"
packer = "latest"
pnpm = "latest"
python = "3.14"
ripgrep = "latest"
shfmt = "latest"
starship = "latest"
stern = "latest"
stylua = "latest"
terraform = "latest"
uv = "latest"
wrangler = "latest"
yarn = "latest"
yq = "latest"

# "asdf:richin13/asdf-neovim" = "latest"

"npm:bash-language-server" = "latest"
"npm:dockerfile-language-server-nodejs" = "latest"
"npm:doctoc" = "latest"
"npm:mcp-hub" = "latest"
"npm:prettier" = "latest"
"npm:tree-sitter-cli" = "latest"
"npm:@astrojs/language-server" = "latest"
"npm:@github/copilot" = "latest"
"npm:@upstash/context7-mcp" = "latest"

"pipx:ansible-core" = { version = "latest", uvx_args = "--with ansible --with cryptography --with kubernetes --with passlib" }
"pipx:huggingface-hub" = "latest"
"pipx:kaggle" = "latest"
"pipx:markitdown" = "latest"
"pipx:ruff" = "latest"
"pipx:ty" = "latest"
"pipx:wandb" = "latest"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install requirements
run: |
apt-get update
apt-get install -y curl gcc git gnupg make tar
apt-get install -y curl

- uses: actions/checkout@v6

Expand Down
File renamed without changes.
99 changes: 7 additions & 92 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,98 +1,13 @@
.PHONY: install
.DEFAULT_GOAL := help

SHELL := /bin/bash
.DEFAULT_GOAL := help

# Define banner style
COL := 120
BANNER := \033[38;2;101;178;255m
CLEAR_COLOR := \033[0m

# List up dotfiles
DOTFILES_XDG_CONFIG := $(shell ls config)

# Define path
DOTPATH := $(HOME)/.dotfiles
BASHMARKS := $(HOME)/src/bashmarks
CAT_BAT := $(HOME)/src/cat-bat

define banner
@sep="$$(for ((i = 1; i < $(COL); i++)); do printf '='; done)"; \
printf "\n$(BANNER)%s %s$(CLEAR_COLOR)\n\n" "$(1)" "$${sep:$${#1}}"
endef

define repo
@if [[ -d "$1" ]]; then \
cd $1 && git pull && git submodule update --init --recursive; \
else \
git clone --depth 1 --recursive https://github.com/$2 "$1"; \
fi
endef

list: ## Show file/directory list for deployment
@$(foreach val, $(DOTFILES_XDG_CONFIG), ls -dF config/$(val);)

install: link shell-setup mise bashmarks bat-theme ## Do installation process

link: ## Create symlink
$(call banner,Create symlinks...)
@mkdir -p $(HOME)/.local/bin
@mkdir -p $(HOME)/{bin,.config,ghe,github,github_hpeprod,work,docker,namespace}
@mkdir -p $(HOME)/ghe/{hpe,yoshio-sugiyama}
@mkdir -p $(HOME)/github/{HPE-TA,IMOKURI,others}
@mkdir -p $(HOME)/github_hpeprod/yoshio-sugiyama_hpeprod
@$(foreach val, $(DOTFILES_XDG_CONFIG), ln -sfnv $(abspath config/$(val)) $(HOME)/.config/$(val);)

shell-setup: ## Setup shell and SSH settings
$(call banner,Setup shell and SSH settings...)
@if ! grep -q '.config/bashrc' "$(HOME)/.bashrc"; then \
echo -e "\nif [[ -f ~/.config/bashrc ]]; then\n . ~/.config/bashrc\nfi" >>"$(HOME)/.bashrc"; \
fi
@if ! grep -q 'export MISE_GITHUB_TOKEN=' "$(HOME)/.bashrc"; then \
echo 'export MISE_GITHUB_TOKEN="$(MISE_GITHUB_TOKEN)"' >> "$(HOME)/.bashrc"; \
fi
@mkdir -p -m 700 ~/.ssh
@touch ~/.ssh/config
@if ! grep -q 'Include ~/.config/ssh/' "$(HOME)/.ssh/config"; then \
echo -e "\nInclude ~/.config/ssh/*.conf" >>"$(HOME)/.ssh/config"; \
fi

mise: ## Setup Mise
$(call banner,Setup Mise...)
@if [[ -f $(HOME)/.local/bin/mise ]]; then \
mise self-update -y; \
mise upgrade; \
mise prune -y; \
else \
curl https://mise.run | sh; \
mise install; \
fi

bashmarks: ## Setup Bashmarks
$(call banner,Setup Bashmarks...)
@$(MAKE) update-bashmarks build-bashmarks

update-bashmarks: ## Update Bashmarks repository
$(call repo,$(BASHMARKS),huyng/bashmarks)

build-bashmarks: ## Build Bashmarks
@cd $(BASHMARKS) && \
make install && \
sed -i 's/^alias l=/# &/' $(HOME)/.bashrc

bat-theme: ## Setup Bat theme
$(call banner,Setup Bat theme...)
@$(MAKE) update-bat-theme build-bat-theme

update-bat-theme: ## Update Bat theme repository
$(call repo,$(CAT_BAT),catppuccin/bat)

build-bat-theme: ## Build Bat theme
@cd $(CAT_BAT) && \
mkdir -p "$(shell bat --config-dir)/themes" && \
cp -f themes/*.tmTheme "$(shell bat --config-dir)/themes" && \
bat cache --build
.PHONY: update
update: ## Bootstrap
mise self-update --yes
mise upgrade
mise prune --yes

.PHONY: help
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / \
{printf "\033[38;2;98;209;150m%-20s\033[0m %s\n", $$1, $$2}' \
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Dotfiles that can be installed by one command

- Clone dotfiles repository.
- Create symbolic links to dotfile.
- Install Neovim and development tools via Mise.
- Install Neovim and development tools.

## Platforms

Expand All @@ -21,17 +21,41 @@ Dotfiles that can be installed by one command
## Requirements

```bash
sudo apt install -y curl gcc git gnupg make tar
sudo apt install -y curl
```

Create a GitHub token without any scope from [here](https://github.com/settings/tokens).

```bash
export MISE_GITHUB_TOKEN="your_github_token"
export MISE_GITHUB_TOKEN="<your_github_token>"
```

## Installation

```bash
bash -c "$(curl -fsSL https://git.io/imokuri)"
```

## Testing

<details>
<summary>Test in Docker</summary>

```bash
docker run -it --rm ubuntu:24.04 bash

apt update
apt install curl git -y

export MISE_GITHUB_TOKEN="<your_github_token>"

git clone https://github.com/IMOKURI/dotfiles.git ~/.dotfiles
cd ~/.dotfiles

# Optional: Change the branch to test
git checkout <branch_name>

bash install
```

</details>
55 changes: 0 additions & 55 deletions config/mise/config.toml

This file was deleted.

13 changes: 7 additions & 6 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ _banner "Download Dotfiles..."

if [[ ! -d "${DOTPATH}" ]]; then
git clone --recursive https://github.com/IMOKURI/dotfiles.git "${DOTPATH}"
mkdir -p ${HOME}/.config
ln -sfnv "${DOTPATH}/.config/mise" "${HOME}/.config/mise"
fi

##### Setup dotfiles #########################################################
##### Bootstrap ##############################################################

_banner "Setup dotfiles..."
_banner "Install mise..."
curl https://mise.run | sh

pushd "$(pwd)"
cd "${DOTPATH}"
make install
popd
_banner "Bootstrap..."
mise bootstrap --yes

##### Instruct next steps #####################################################

Expand Down