From c3e8b3ba09d9b4c9a0a0a86639ee850d300c025c Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:02:42 -0500 Subject: [PATCH] chore: cleanup --- Dockerfile | 9 --- Makefile | 6 +- README.md | 29 +++++++++- home/.chezmoi.yaml.tmpl | 16 ++++-- home/.chezmoidata.yaml | 4 ++ home/Brewfile | 122 ++++++++++++++++------------------------ home/dot_bashrc | 2 +- 7 files changed, 97 insertions(+), 91 deletions(-) create mode 100644 home/.chezmoidata.yaml diff --git a/Dockerfile b/Dockerfile index 72ecd3f..a5d3d19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,20 +22,11 @@ ARG USERNAME=pragmaticivan ARG USER_UID=1000 ARG USER_GID=${USER_UID} -<<<<<<< Updated upstream -ENV TZ=America/Chicago -======= -<<<<<<< Updated upstream -ENV TZ=Asia/Tokyo ->>>>>>> Stashed changes -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -======= RUN groupadd --gid ${USER_GID} ${USERNAME} \ && useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} -G sudo -s /bin/bash \ && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ && echo 'Defaults verifypw = any' >> /etc/sudoers USER ${USERNAME} ->>>>>>> Stashed changes WORKDIR /home/${USERNAME} diff --git a/Makefile b/Makefile index f73e861..0e2ba2e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ DOCKER_IMAGE_NAME=dotfiles -DOCKER_PLATFORM=linux/amd64 +DOCKER_PLATFORM=linux/arm64 # # Docker # @@ -24,8 +24,8 @@ docker-build-dev: --platform $(DOCKER_PLATFORM) . \ --build-arg USERNAME="$$(whoami)" -.PHONY: docker-run-dev -docker-run-dev: docker-build-dev +.PHONY: docker-dev +docker-dev: docker-build-dev docker run --rm -it \ -v "$$(pwd):/home/$$(whoami)/.local/share/chezmoi" \ --platform $(DOCKER_PLATFORM) $(DOCKER_IMAGE_NAME) \ diff --git a/README.md b/README.md index 954ec69..8dfb05a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,33 @@ The following is a minimal setup command to install chezmoi and my dotfiles from > sh -c "$(curl -fsLS get.chezmoi.io)" -- init pragmaticivan --apply +## ๐Ÿ› ๏ธ Update & Test ๐Ÿงช + +Updating and testing the dotfiles follows [chezmoi's daily operations](https://www.chezmoi.io/user-guide/daily-operations/). +To verify that the updated scripts work correctly, run the scripts on the actual local machine and on the docker container. + +### ๐Ÿณ Test on Docker Container + +Test the executation of the setup scripts on Ubuntu in its initial state. +The following command will launch the test environment using Docker ๐Ÿณ. + +```shell +make docker-dev + +# docker run -it -v "$(pwd):/home/$(whoami)/.local/share/chezmoi" dotfiles /bin/bash --login +# pragmaticivan@6f97d279cb51:~$ +``` + +Run the [`chezmoi init --apply`](https://www.chezmoi.io/user-guide/setup/#use-a-hosted-repo-to-manage-your-dotfiles-across-multiple-machines) command to verify that the system is set up correctly. + +```shell +pragmaticivan@5f93d270cb51:~$ chezmoi init --apply +``` + +### ๐Ÿฆ‡ Unit Test with [Bats](https://github.com/bats-core/bats-core) [![Unit test](https://github.com/pragmaticivan/dotfiles/actions/workflows/macos.yaml/badge.svg)](https://github.com/pragmaticivan/dotfiles/actions/workflows/macos.yaml) + +Test the shellscript for setup with [Bash Automated Testing System (bats)](https://github.com/bats-core/bats-core). +The scripts for the unit test can be found under [`./tests`](https://github.com/pragmaticivan/dotfiles/tree/main/tests) directory. ## ๐Ÿ‘ Acknowledgements @@ -42,4 +69,4 @@ Inspiration and code was taken from many sources, including: ## ๐Ÿ“ License -The code is available under the [MIT license](https://github.com/pragmaticivan/dotfiles/blob/master/LICENSE). +The code is available under the [MIT license](https://github.com/pragmaticivan/dotfiles/blob/main/LICENSE). diff --git a/home/.chezmoi.yaml.tmpl b/home/.chezmoi.yaml.tmpl index 959cda6..f8b43d5 100644 --- a/home/.chezmoi.yaml.tmpl +++ b/home/.chezmoi.yaml.tmpl @@ -1,3 +1,8 @@ +{{- $gitemail := "301291+pragmaticivan@users.noreply.github.com" -}} +{{- $name := "Ivan Santos" -}} +{{- $editor := "Ivan Santos" -}} +{{- $visual_editor := "Ivan Santos" -}} + {{- $system := "" -}} {{- if hasKey . "system" -}} {{- $system = .system -}} @@ -8,9 +13,12 @@ {{- $system = promptString "System (client or server)" -}} {{- end -}} +sourceDir: {{ .chezmoi.sourceDir }} + +--- data: - name: "Ivan Santos" - gitemail: "301291+pragmaticivan@users.noreply.github.com" system: {{ $system | quote }} - editor: "nvim" - visualeditor: "code" + name: {{ $name | quote }} + gitemail: {{ $gitemail | quote }} + editor: {{ $editor | quote }} + visualeditor: {{ $visual_editor | quote }} diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml new file mode 100644 index 0000000..4b0218c --- /dev/null +++ b/home/.chezmoidata.yaml @@ -0,0 +1,4 @@ +name: "Ivan Santos" +gitemail: "301291+pragmaticivan@users.noreply.github.com" +editor: "nvim" +visualeditor: "code" diff --git a/home/Brewfile b/home/Brewfile index e7b1c4e..19745c0 100644 --- a/home/Brewfile +++ b/home/Brewfile @@ -6,103 +6,79 @@ # # See https://github.com/Homebrew/homebrew-bundle +# Taps # tap "homebrew/bundle" -# tap "saulpw/vd" # CASKS # - -# Development Tools -cask "homebrew/cask/docker" # Docker -cask "visual-studio-code" # Vscode +cask "1password" cask "alacritty" - -# Communication Tools +cask "blackhole-2ch" +cask "clocker" cask "discord" +cask "firefox" +cask "flameshot" +cask "font-fira-code-nerd-font" +cask "font-fira-mono-nerd-font" +cask "font-jetbrains-mono" +cask "font-meslo-for-powerline" +cask "google-chrome" +cask "hammerspoon" +cask "homebrew/cask/docker" +cask "iina" +cask "imageoptim" +cask "keka" +cask "little-snitch" +cask "netnewswire" cask "notion" +cask "raycast" +cask "sensei" cask "slack" +cask "spotify" cask "telegram" +cask "transmission" +cask "visual-studio-code" cask "whatsapp" +cask "whisky" cask "zoom" - -# Utility Tools -cask "blackhole-2ch" -cask "imageoptim" -cask "sensei" -cask "keka" -cask "flameshot" -cask "hammerspoon" -cask "little-snitch" -cask "1password" -cask "netnewswire" # cask "monodraw" - To evaluate # cask "bartender" - To evaluate + +# MAS # # mas "Affinity Photo 2: Image Editor", id: 1616822987 # mas "Affinity Designer 2", id: 1616831348 # mas "Amphetamine", id: 937984704 # mas "Deliveries: a package tracker", id: 290986013 -# Entertainment Tools -cask "iina" -cask "whisky" - -# Productivity Tools -cask "raycast" - -# Browsers -cask "google-chrome" -cask "firefox" - -# Fonts -cask "font-fira-code-nerd-font" -cask "font-fira-mono-nerd-font" -cask "font-meslo-for-powerline" -cask "font-jetbrains-mono" - # BREW # - -# General packages for development and system management -brew "aspell" # Spell checker - -# Encryption and security tools - - -# Media-related packages - - -# Text and terminal utilities -brew "jq" -brew "zellij" -brew "starship" -brew "nvim" -brew "zsh" +brew "1password-cli" brew "antidote" +brew "aspell" brew "atuin" -brew "zoxide" -brew "mise" -brew "fzf" -brew "tealdeer" -brew "lazygit" -brew "lsd" -brew "ripgrep" -brew "fd" -brew "yazi" -brew "ffmpegthumbnailer" -brew "unar" -brew "poppler" -brew "golangci-lint" brew "bash-completion" brew "bat" -brew "btop" -brew "gh" -brew "fd" brew "bats-core" +brew "btop" brew "chezmoi" -# brew "visidata" - To evaluate - -# Cross-shell prompt - -# Cloud Tools +brew "fd" +brew "ffmpegthumbnailer" +brew "fzf" +brew "gh" +brew "golangci-lint" +brew "jq" brew "kubecolor" brew "kubectx" -brew "minikube" brew "lazydocker" +brew "lazygit" +brew "lsd" +brew "minikube" +brew "mise" +brew "nvim" +brew "poppler" +brew "ripgrep" +brew "starship" +brew "tealdeer" +brew "unar" +brew "yazi" +brew "zellij" +brew "zoxide" +brew "zsh" diff --git a/home/dot_bashrc b/home/dot_bashrc index 2927baf..4c3469f 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -1 +1 @@ -export PATH="$PATH:$HOME/.local/bin" +export PATH=$HOME/.bin:$PATH