Skip to content

πŸ”΅ How I backup, restore and synchronise my shell / system preferences and settings.

License

Notifications You must be signed in to change notification settings

gnugat/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”΅ Super Secret Dotfiles (SSDF)

This repository helps me backup, restore, synchronise and share my shell / system preferences and settings.

ℹ️ Requirements:

  • 🍊 Ubuntu (apt), or 🍏 Mac OS (brew)
  • πŸ’² bash to run the installation scripts
  • πŸ™ git to clone the repo, or 🌐 curl and πŸ“¦ tar to download it

πŸš€ Installation

Clone the repository in ~/.dotfiles, then run its root install.sh script:

git clone [email protected]:gnugat/dotfiles.git ~/.dotfiles && cd ~/.dotfiles && bash ./install.sh

Once 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 ./11-shell/install.sh \
    && bash ./12-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.sh

🌳 Philosophy / Structure

The tree directory follows this convention:

.
β”œβ”€β”€ <xy>-<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 <xy> prefix digit indicates the package's:

  • x: tag
    • 0: 🏭 Internal SSDF functions
    • 1: 🧸 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)
  • y: priority

As for each <package>/install.sh script, their responsibility is to:

  • πŸ“€ select a Package Manager from one of the supported ones
    • eg apt (or brew)
  • πŸ“¦ install the package using the selected Package Manager
    • eg sudo apt -qqy installl git
  • πŸ”— create symlinks of config files to ~/
    • eg ln -nsf ./config/gitconfig ~/.gitconfig
  • βž• do some extra stuff like installing plugins, themes and whatnot

ℹ️ Notes:

  • the install.sh scripts 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

πŸ‹ Docker Container and Testing

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.sh

Speaking 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-apt

Note: 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.sh

Note: The install.mac.sh script 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.

🀝 Be kind

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.

About

πŸ”΅ How I backup, restore and synchronise my shell / system preferences and settings.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published