Recreate your own private environment in a Linux environment#

We will summarize the steps and ideas for quickly starting up your own environment in a new Linux environment.

Environment setup is completed in 3 steps#

Actually you just need to run 3 commands. It is also written in README.md so that it can be referenced at any time.

  1. Installing required packages

  2. Bare-repo management of dotfiles

  3. Run install.sh

The contents are as follows.

# 1) 必要なパッケージのインストール
sudo apt update -y && sudo apt install -y git curl vim

# 2) dotfiles の bare-repo 方式での管理
git clone --bare https://github.com/mtakagishi/dotfiles.git $HOME/.dotfiles \
&& git --git-dir=$HOME/.dotfiles --work-tree=$HOME checkout --force \
&& git --git-dir=$HOME/.dotfiles --work-tree=$HOME \
      config --local status.showUntrackedFiles no

# 3) install.sh の実行
bash ~/.config/bootstrap/install.sh

Organizing ideas and operating methods#

  • Maintenance is possible without affecting the startup procedure

    • dotfiles are managed using Bare-repo method and pushed to git each time they are developed.

    • The setup procedure is summarized in install.sh. Edit each time you train and push to git

Quality maintenance through CI#

Use Github Actions to maintain the quality of install.sh.

  • Add a CI configuration file called .github/workflows/dotfiles-ci.yml.

  • In addition to push and pull_request triggers, you can also set weekly executions.

  • For the contents, see here <mtakagishi/dotfiles>`_

Add badge#

Add a CI badge to README.md so you can see it visually.

  • CI badges are written as follows:

    ![Dotfiles Setup](https://github.com/mtakagishi/dotfiles/actions/workflows/dotfiles-ci.yml/badge.svg)
    
  • The badge will look like this:

    Dotfiles Setup

Conclusion#

Using the steps and ideas summarized here, you can recreate your own custom environment at any time. Additionally, CI can maintain quality with git push triggers, weekly triggers, and visual confirmation with badges.

Reference link#

Article information

Post date:

2025-05-04

author:

Mr. Takagi