This repository helps me backup, restore, synchronise and share my shell / system preferences and settings.
βΉοΈ Requirements:
- π Ubuntu (
apt), or π Mac OS (brew)- π²
bashto run the installation scripts- π
gitto clone the repo, or πcurland π¦tarto download it
Clone the repository in ~/.dotfiles, then run its root install.sh script:
git clone git@github.com:gnugat/dotfiles.git ~/.dotfiles && cd ~/.dotfiles && bash ./install.shOnce the script is done, don't forget to run source ~/.profile to reload the config.
π’ Alternative Installation Options
π To install on Mac OS (will install homebrew πΊ):
BRANCH="main" \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles" \
&& bash ./install.mac.shπ·οΈ Instead of installing everything, a list of tags can be specified by setting SSDF_TAGS:
BRANCH="main" \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles" \
&& SSDF_TAGS="0 1" bash ./install.shπ To only install one or more specific packages:
BRANCH="main" \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles" \
&& bash ./101-shell/install.sh \
&& bash ./102-bash/install.shβοΈ It's also possible to specify which (supported) package manager to use,
rather than letting the scripts automatically select one by setting SSDF_PACKAGE_MANAGER:
BRANCH="main" \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles" \
&& SSDF_PACKAGE_MANAGER="brew" bash ./install.shThe tree directory follows this convention:
.
βββ <xyy>-<package>
βΒ Β βββ _<package-manager>.sh
βΒ Β βββ config/
βΒ Β βββ install.sh
βΒ Β βββ README.md
βββ install.sh
The root install.sh script will call all the Package install.sh scripts.
The <xyy> prefix digit indicates the package's:
x: tag0: π Internal SSDF functions1: π§Έ Bare minimum (ideal for ssh servers, or Docker Containers)2: π§± Base minimal (common set up)3: π₯ Bang (productivity, common)4: π Ubuntu (OS specific)5: π Mac OS (OS specific)6: π Nui-Rama (laptop specific)
yy: priority (numeric, 00-99)
As for each <package>/install.sh script, their responsibility is to:
- π€ select a Package Manager from one of the supported ones
- eg
apt(orbrew)
- eg
- π¦ install the package using the selected Package Manager
- eg
sudo apt -qqy installl git
- eg
- π create symlinks of config files to
~/- eg
ln -nsf ./config/gitconfig ~/.gitconfig
- eg
- β do some extra stuff like installing plugins, themes and whatnot
βΉοΈ Notes:
- the
install.shscripts can safely be run many times
- this allows for updates
β οΈ no backups are made, and some artefacts might be left behind, make sure to double check and manually backup/clean
A "minimal" setup (prompt and aliases) is available, for example to spice things up when in a Docker Container:
BRANCH="main" \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles" \
&& SSDF_TAGS="0 1" bash ./install.shSpeaking of Docker Containers, Dockerfiles are available to try out the repo:
docker build -t gnugat/dotfiles-apt -f Dockerfile.apt .
docker run --rm -it gnugat/dotfiles-aptNote: The container doesn't come with the dotfiles installed, you'll have to run the curl or git command.
π Mac Simulator
The `Dockerfile.brew` provides Ubuntu with linuxbrew and zsh, to simulate a Mac environment:docker build -t gnugat/dotfiles-apt -f Dockerfile.brew .
docker run --rm -it gnugat/dotfiles-brew
# In the brew container:
BRANCH=main \
; mkdir -p "${HOME}/.dotfiles" \
&& curl -fsSL "https://github.com/gnugat/dotfiles/archive/${BRANCH}.tar.gz" \
| tar -xz -C "${HOME}/.dotfiles" --strip-components=1 \
&& cd "${HOME}/.dotfiles \
&& SSDF_PACKAGE_MANAGER="brew" SSDF_TAGS="0 1 2" bash ./install.shNote: The
install.mac.shscript will not work as the container is running Linux and not Darwin. For the same reason, avoid selecting Ubuntu or Mac specific tags.
Note: Remember that once you exit the container, all changes are lost. If you run the container again, you'll need to install the Dotfiles once more.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
See Contributor Covenant Code of Conduct.
It is also using the Hippocratic License, which means that this project is Open Source, but it is forbidden to use it in a way that promotes or profits from:
- violence, hate and division,
- environmental destruction,
- abuse of human rights,
- the destruction of peopleβs physical and mental health
See Hippocratic License.