https://github.com/arrrgi/dotfiles
🏡 MacOS / Ubuntu / WSL / Codespaces dotfiles managed by Chezmoi
https://github.com/arrrgi/dotfiles
chezmoi dotfiles linux macos neovim tmux ubuntu wezterm wsl2 zsh
Last synced: 7 months ago
JSON representation
🏡 MacOS / Ubuntu / WSL / Codespaces dotfiles managed by Chezmoi
- Host: GitHub
- URL: https://github.com/arrrgi/dotfiles
- Owner: arrrgi
- License: mit
- Created: 2023-04-10T14:07:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-11T04:17:50.000Z (9 months ago)
- Last Synced: 2025-01-11T05:20:40.350Z (9 months ago)
- Topics: chezmoi, dotfiles, linux, macos, neovim, tmux, ubuntu, wezterm, wsl2, zsh
- Language: Shell
- Homepage: https://dotfiles.bald.engineer
- Size: 581 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Dotfiles
## Description
Opinionated dotfiles for \*nix based personal and work development environments,
managed by [Chezmoi](https://www.chezmoi.io).## Installation
**Requirements:**
1. Ubuntu (VM, Baremetal or WSL) or MacOS target operating system
2. curl installed in target operating system**Run:**
```bash
sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init --apply arrrgi [--branch=ref] --use-builtin-git=true
```## Dotfiles Decision Tree
Chezmoi runs context/OS specific scripts and applies relevant dotfiles using the
high-level logic outlined.```mermaid
graph TD
Start((Start))
Start --> TTY{Is the session a TTY?}
TTY -- False --> checkContainer{Is the session within
a Docker container?}
checkContainer -- True --> setContainer[Set Container
context Variables]
setContainer --> Success[End logic with
success message]
checkContainer -- False --> Error[Exit with error message]
Error --> Finish((Finish))
Success --> ApplyTemplate[Apply Chezmoi Template]
ApplyTemplate --> Finish
TTY -- True --> promptName[Prompt for full name]
promptName --> whichOS{Check OS Logic}
whichOS --> checkMacOS{Is the OS MacOS?}
whichOS --> checkWSL{Is the OS WSL?}
whichOS --> checkUbuntu{Is the OS Ubuntu?}
whichOS -- Other --> Error
checkWSL -- False --> Error
checkUbuntu -- False --> Error
checkMacOS -- True --> setMacOS[Set MacOS
context Variables]
checkMacOS -- False --> Error
checkWSL -- True --> setWSL[Set WSL
context Variables]
checkUbuntu -- True --> checkRootAccess{Do you have root access?}
checkRootAccess -- True --> setUbuntuRoot[Set Ubuntu with root
context Variables]
checkRootAccess -- False --> setUbuntuNormal[Set Ubuntu without root
context Variables]
setMacOS --> Success
setWSL --> Success
setUbuntuRoot --> Success
setUbuntuNormal --> Success
```This could be interpreted as the following pseudo-Bash script which minimises
the number of nested condition statements by using guard clauses. This aligns
closely to the way the Chezmoi base template evaluates conditions, captures
necessary inputs from _**stdin**_ during installation and then executes context
and OS specific scripts and config to the target environment.Additional detail on the conditional logic and inputs required is available in
the [documentation](https://dotfiles.bald.engineer) for this repo.```bash
#!/bin/bashecho "Start"
echo "-----"# Check if the session is a TTY
echo "Is this a TTY session? (y/n)"
read is_ttyif [ "$is_tty" == "n" ]; then
# Check if the session is within a Docker container
echo "Is the session within a Docker container? (y/n)"
read is_containerif [ "$is_container" == "y" ]; then
# Set container context variables
echo "Setting Container context variables..."
# Perform necessary operationsecho "End logic with success message"
echo "Apply Chezmoi Template"
else
echo "Exit with error message"
echo "Finish"
fi
else
echo "Is the OS MacOS? (y/n)"
read is_macosif [ "$is_macos" == "y" ]; then
# Set MacOS context variables
echo "Setting MacOS context variables..."
# Perform necessary operationsecho "End logic with success message"
echo "Apply Chezmoi Template"
elif [ "$is_macos" == "n" ]; then
echo "Is the OS WSL? (y/n)"
read is_wslif [ "$is_wsl" == "y" ]; then
# Set WSL context variables
echo "Setting WSL context variables..."
# Perform necessary operationsecho "End logic with success message"
echo "Apply Chezmoi Template"
else
echo "Is the OS Ubuntu? (y/n)"
read is_ubuntuif [ "$is_ubuntu" == "y" ]; then
echo "Do you have root access? (y/n)"
read has_root_accessif [ "$has_root_access" == "y" ]; then
# Set Ubuntu context variables with root
echo "Setting Ubuntu with root context variables..."
# Perform necessary operationsecho "End logic with success message"
echo "Apply Chezmoi Template"
elif [ "$has_root_access" == "n" ]; then
# Set Ubuntu context variables without root
echo "Setting Ubuntu without root context variables..."
# Perform necessary operationsecho "End logic with success message"
echo "Apply Chezmoi Template"
else
echo "Exit with error message"
echo "Finish"
fi
else
echo "Exit with error message"
echo "Finish"
fi
fi
else
echo "Exit with error message"
echo "Finish"
fi
fi
```## License
MIT