yadm-bootstrap
Initialize yadm repository and deploy configuration
TLDR
Execute bootstrap executable
SYNOPSIS
yadm bootstrap
DESCRIPTION
yadm-bootstrap is a subcommand of the yadm dotfile manager, specifically designed for the initial setup and configuration of a new Linux system. Its primary purpose is to automate the installation of packages and execution of scripts immediately after the user's yadm dotfiles repository has been cloned.
The typical workflow involves first cloning your yadm repository (which contains your dotfiles and yadm configurations) to the home directory, and then executing yadm bootstrap. This command will look for specific configuration files:
~/.config/yadm/bootstrap (or ~/.yadm/bootstrap as a fallback) for package definitions, and
the bootstrap section within ~/.config/yadm/config (or ~/.yadm/config) for script execution.
If a `bootstrap` file exists, yadm attempts to install listed packages using the appropriate system package manager (e.g., `apt`, `dnf`, `pacman`). Concurrently, commands specified in the `bootstrap` section of the config file are executed, allowing for custom setup tasks like setting permissions, creating directories, or launching other setup scripts. This command streamlines the process of getting a new machine quickly configured to a user's preferred environment.
CAVEATS
- Requires a yadm repository to be already cloned to the system for the configuration files (~/.yadm/bootstrap and ~/.yadm/config) to be present and effective.
- Relies on the system having an identifiable package manager (e.g., `apt`, `dnf`, `pacman`) for automatic package installation.
- Scripts executed via the bootstrap section of the config file run with the current user's permissions, so root-level operations might require `sudo` within those scripts.
BOOTSTRAP CONFIGURATION FILES
The behavior of yadm bootstrap is defined by two key configuration sources:
1. ~/.config/yadm/bootstrap (or ~/.yadm/bootstrap): This file lists packages to be installed. Each line typically contains a package name. `yadm` attempts to use the system's package manager to install these.
2. The bootstrap section within ~/.config/yadm/config (or ~/.yadm/config): This section contains shell commands that will be executed sequentially. It allows for arbitrary scripting, such as creating directories, setting up symlinks, or running other setup tools that are not directly handled by package installation.
HISTORY
The bootstrap functionality is a core component of yadm, a dotfile manager created by TheLocehiliosan. It was designed from early stages to address the common need for a streamlined initial setup process on new systems, allowing users to quickly configure their environment after deploying their dotfiles. Its integration provides a robust and automated way to handle dependencies and run post-install scripts, reflecting a focus on ease of use and reproducibility for dotfile management.