A deployment bundle for Divine.dotfiles
The deployment bundle essentials for Divine.dotfiles is a collection of opinionated system set-up scripts.
It is intended as a useful starting point for any Unix-like box.
(Additionally, this bundle showcases the recommended use of the mechanisms built into the current version of the Divine.dotfiles framework.)
| Bundle name |
|
| Deployments |
10 |
| Divinefile entries |
9 |
| Attached bundle location |
|
Once the bundle is fully installed, and the shell reloaded, voilà:
-
Zsh is the default shell.
-
Zsh is augmented with completions, syntax highlighting, and auto-suggestions.
-
Basic necessities, such as Git, Vim, and GnuPG are available.
-
Both oh-my-zsh and Bash-it frameworks are installed and loaded.
-
A minimalistic theme for both shell frameworks is active.
-
Opinionated configs are plugged in for Git, Vim, Bash, and Zsh.
-
Any pre-existing files that have gotten in the way are safely backed up or re-used.
All of the above is controlled and customized through the key configuration files, which are located at ~/.grail/assets/.
essentials
The global configuration for Git. |
The global configuration for Vim. |
The file |
The container for the personal executables (this directory is maintained on the |
The dagger mark (†) meaning: in order for the modifications in that asset directory to take effect, the deployment must be (re-)installed. |
The bundle essentials requires the Divine.dotfiles framework.
The (un)installation guide assumes that Divine.dotfiles is installed into the default path: ~/.divine/, and that the shortcut command di is available.
With Divine.dotfiles already installed, the following Terminal command attaches the bundle essentials to the Grail directory:
di attach essentialsAnd the following Terminal command installs the attached bundle:
di install --bundle essentialsAny pre-existing files that get in the way are either re-used or backed up. Upon the uninstallation, such files are restored into their original places. |
The following Terminal command uninstalls the bundle essentials:
di remove --bundle essentialsAnd the following Terminal command detaches the bundle from the Grail directory:
di detach essentialsThe bundle essentials includes a Divinefile that maintains the following system packages.
Below is the list of the more prominent packages in the Divinefile.
The Divinefile itself provides the full list.
It is located in the root of the attached bundle’s directory at:
-
state/bundles/divine-bundles/essentials/Divinefile
essentials| Priority | Package name | Package notes |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Except macOS, where it is pre-installed. |
|
|
Except macOS, where it is pre-installed. |
|
|
|
|
|
The config-shell deployment symlinks the configuration files ('runcoms') for Bash and Zsh into the home directory.
-
Deployment name:
config-shell -
Priority:
333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/config-shell/ -
Asset directory (
<asset-dir>):~/.grail/assets/config-shell/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/config-shell/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
config-shell deployment
Symlinking
|
|||||||||||||||||
-
The base runcoms (the
.*profileand.*rcfiles recognized by Bash and Zsh) do little on top of sequentially sourcing the custom and box-specific runcoms. -
The root of the asset directory is home for the custom runcoms.
During the shell startup, both
.bashrcand.zshrcsource files from this directory, in the ascending alphanumerical order:-
The
.bashrcscript sources every<name>.bashand every<name>.shfile. -
The
.zshrcscript sources every<name>.zshand every<name>.shfile.
A sample set of opinionated runcoms is included.
-
-
The empty-ish box-specific runcoms are created in the home directory, and are not intended to leave the current machine:
-
Sourced before the custom runcoms:
-
~/.pre.bash— exclusive to Bash. -
~/.pre.zsh— exclusive to Zsh. -
~/.pre.sh— universal.This particular runcom is pre-loaded with the definitions of the
D__OS_FAMILY,D__OS_DISTRO, andD__OS_PKGMGRvariables, which describe the current OS.
-
-
Sourced after the custom runcoms:
-
~/.post.bash— exclusive to Bash. -
~/.post.zsh— exclusive to Zsh. -
~/.post.sh— universal.
-
-
-
~/.hushlogin— the presence of this file in the home directory prevents any sort of textual banner from being printed durint the shell startup.
The following custom runcoms are provided with the deployment and contain an opinionated set of startup commands:
-
00-config.bash— the general Bash configuration commands. -
00-config.zsh— the general Zsh configuration commands. -
01-bash-it.bash— the commands that initialize the Bash-it framework, if it is installed. -
01-oh-my-zsh.zsh— the commands that initialize the oh-my-zsh framework, if it is installed. -
02-env.sh— the environment variables for both shells, including the modifications of the$PATHvariable. -
03-fixes.sh— the bug fixes for both shells. -
04-aliases.sh— the aliases for both shells. -
05-funcs.sh— the utility functions for both shells. -
06-addons.zsh— the commands that initialize the addons for Zsh.
The config-shell deployment is stand-alone.
However, it provides the support for other deployments in the current bundle (via the included custom runcoms):
-
01-bash-it.bash— initializes the Bash-it framework for thebash-itdeployment. -
01-oh-my-zsh.zsh— initializes the oh-my-zsh framework for theoh-my-zshdeployment. -
02-env.sh— ensures that all flavors ofbindirectory are on the$PATHvariable for thehome-dirsandportable-bindeployments. -
06-addons.zsh— initializes the Zsh addons for thezsh-addonsdeployment.
The config-git deployment symlinks the configuration files for Git into the home directory.
-
Deployment name:
config-git -
Priority:
333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/config-git/ -
Asset directory (
<asset-dir>):~/.grail/assets/config-git/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/config-git/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
config-git deployment
Symlinking
|
The two global configuration files for Git are provided:
-
.gitconfig— this file is interacted with by thegit config --globalcommand. -
.gitattributes— this file globally influences certain Git operations by assigning attributes to the certain file path patterns.
A small amount of opinionated configuration is included in the specified files.
The config-git deployment is stand-alone.
The Divinefile included with the current bundle ensures that Git is installed.
The config-vim deployment symlinks the configuration and customization files for Vim into the home directory.
-
Deployment name:
config-vim -
Priority:
333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/config-vim/ -
Asset directory (
<asset-dir>):~/.grail/assets/config-vim/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/config-vim/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
config-vim deployment
Symlinking
|
The native configuration files, containing an opinionated set of Vim startup commands:
-
.vimrc— the primary Vim configuration file.This file includes an installation command for the vim-plug (a minimalist Vim plugin manager) along with some plugins and settings.
-
.ideavimrc— the configuration file for the IdeaVim (a Vim emulation plugin for IDEs based on the IntelliJ Platform).If you don’t use any of the IntelliJ products, this file is harmless.
A number of Vim customization directories can be created in the root of the .vim/ directory, as containers for your customizations.
One keymap is provided as an example:
-
keymap/shifted.vim— the 'Caps Lock' mode toggled by double-tappingj.
Overall, the following customization directories are supported by Vim:
-
after/— the files to be loaded after the files inplugin/. -
autoload/— the files to be loaded when they are actually needed. -
colors/— the color schemes. -
compiler/— the compiler-related options in the current buffer. -
doc/— the custom plugin documentation. -
ftdetect/— the file type detection plugins. -
ftplugin/— the file type exclusive plugins. -
indent/— the file type exclusive indentation settings. -
keymap/— the key mapping files. -
lang/— the language files. -
macros/ -
plugin/— the standard plugins. -
syntax/— the syntax highlighting plugins. -
tools/
The Vim help provides more information on the semantics of each directory.
The config-vim deployment is stand-alone.
The Divinefile included with the current bundle ensures that Vim is installed.
The portable-bin deployment uses its own asset directory as a portable container for the personal executables.
-
Deployment name:
portable-bin -
Priority:
500 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/portable-bin/ -
Asset directory (
<asset-dir>):~/.grail/assets/portable-bin/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/portable-bin/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
portable-bin deployment
Symlinking
|
Everything dropped into the portable-bin deployment’s asset directory immediately becomes available on $PATH.
The portability is achieved when the Grail directory is synchronized across machines (as it is encouraged to be — e.g., using Dropbox or Github).
The included asset directory starts out empty.
The portable-bin deployment depends on the config-shell deployment (included in the current bundle).
The ~/.pbin/ directory is put on the $PATH variable from the runcom script at ~/.grail/assets/config-shell/02-env.sh.
The home-dirs deployment maintains a stable tree of personal directories under the home directory.
-
Deployment name:
home-dirs -
Priority:
500 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/home-dirs/ -
Asset directory (
<asset-dir>):~/.grail/assets/home-dirs/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/home-dirs/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
home-dirs deployment
Creating
|
The home-dirs deployment:
-
parses the
home-dirs.cfgfile as a queue manifest; -
treats entries as relative paths;
-
ensures that the paths correspond to sub-directories under the home directory.
The home-dirs.cfg is a queue manifest.
It uses the key-value pairs to denote sections or entries that are only relevant for particular OS’s.
By default, every entry is relevant everywhere.
A whitespace-separated list of OS’s may be provided.
The entire list may be negated by prepenting it with an exclamation mark (!).
A key-value that appears on a line of its own comes into effect for the remainder of the manifest, or until overridden. A key-value on the same line with an entry affects only that entry.
(os: debian) relative/path/to/directory1 # Debian only
(os: macos bsd) relative/path/to/directory2 # macOS/BSD only
(os: ! wsl cygwin) relative/path/to/directory3 # Everything except WSL or Cygwin
(os: all) relative/path/to/directory4 # 'all'/'any' are reserved values that denote any OSThe queue manifest syntax is documented in the framework’s documentation. |
The zsh-addons deployment retrieves a number of community addons for Zsh: completions, syntax highlighting, and auto-suggestions.
-
Deployment name:
zsh-addons -
Priority:
1000 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/zsh-addons/ -
Asset directory (
<asset-dir>):~/.grail/assets/zsh-addons/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/zsh-addons/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
zsh-addons deployment
Retrieving Github repositories
|
The zsh-addons deployment depends on the config-shell deployment (included in the current bundle).
The retrieved addons are initialized from the runcom script at ~/.grail/assets/config-shell/06-addons.zsh.
The zsh-default deployment ensures that Zsh is the default shell for the current OS user.
-
Deployment name:
zsh-default -
Priority:
1333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/zsh-default/ -
Asset directory (
<asset-dir>):~/.grail/assets/zsh-default/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/zsh-default/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
After some preparations (involving the /etc/shells file), the zsh-default deployment calls the chsh -s <path to zsh> command to change the default shell.
Note that changing the default shell requires the user’s password.
The password prompt will appear during the installation/removal.
The zsh-default deployment is stand-alone.
On some systems, the Divinefile included with the current bundle ensures that the chsh utility is installed.
The brewfile deployment maintains a set of system dependencies on macOS using the Brewfile.
-
Deployment name:
brewfile -
Priority:
3000 -
Flags:
! -
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/brewfile/ -
Asset directory (
<asset-dir>):~/.grail/assets/brewfile/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/brewfile/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
The brewfile deployment is flagged as dangerous for two reasons:
-
Checking whether a Brewfile is installed or not is not reliable.
-
Uninstalling a Brewfile is not implemented on Homebrew’s side, and this deployment’s implementation is an approximation.
As a result of the flag, the brewfile deployment is not processed by the intervention utility, unless the --with-! option is given.
brewfile deployment
Installing
|
The brewfile deployment delegates to the brew utility to install whatever items are listed in the provided Brewfile.
Uninstalling a Brewfile, however, is currently not supported by Homebrew.
The brewfile deployment provides a workaround.
Upon removal of this deployment, the Brewfile is read in reverse order: for every supported line, the appropriate Homebrew uninstallation command is called.
This procedure is not an exact reverse of the installation due to the possible transient dependencies, as well as other factors.
Currently, the removal of the following Brewfile lines is supported:
-
tap <name>— taps will be untapped. -
cask <name>— casks will be uninstalled. -
brew <name>— bottles will be uninstalled.
The included Brewfile starts up empty, and as such does nothing.
The fundamental dependencies of the current bundle are handled by the included Divinefile.
In other words, the Brewfile is kind of scoffed on around here.
The brewfile deployment is stand-alone.
On macOS, the Divine.dotfiles framework itself ensures that Homebrew is installed.
The bash-it deployment introduces the Bash-it framework and custom assets for it into the home directory.
-
Deployment name:
bash-it -
Priority:
3333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/bash-it/ -
Asset directory (
<asset-dir>):~/.grail/assets/bash-it/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/bash-it/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
bash-it deployment
Retrieving Github repositories
|
|||||||||||||||||
Symlinking
|
The bash-it deployment clones or downloads the Bash-it/bash-it repository into the ~/.bash-it/ directory.
Having succeeded, it symlinks additional assets into the framework.
The Bash-it framework is installed with its included installation script.
The --no-modify-config option is added because the current bundle already includes the necessary initialization commands.
Blank sample files are provided for each kind of custom assets:
-
aliases/divine.aliases.bash -
completion/divine.completion.bash -
lib/divine.bash -
plugins/divine.plugin.bash
A working minimalistic theme is provided for the custom themes:
-
themes/laidbare/laidbare.theme.bashThis theme is also defaulted to in the provided initialization commands.
The bash-it deployment depends on the config-shell deployment (included in the current bundle).
The retrieved Bash-it framework is initialized from the runcom script at ~/.grail/assets/config-shell/01-bash-it.bash.
The same file may and should be used to customize the Bash-it framework’s loadout.
The oh-my-zsh deployment introduces the oh-my-zsh framework and custom assets for it into the home directory.
-
Deployment name:
oh-my-zsh -
Priority:
3333 -
Flags: none
-
Deployment directory (
<dpl-dir>):state/bundles/divine-bundles/essentials/oh-my-zsh/ -
Asset directory (
<asset-dir>):~/.grail/assets/oh-my-zsh/Assets are never removed from the Grail, even when uninstalling the deployment.
-
Backup directory (
<backup-dir>):state/backups/oh-my-zsh/ -
Zero data loss: any displaced files are backed up.
-
Reversibility: backed up files are restored, re-used ones untouched.
oh-my-zsh deployment
Retrieving Github repositories
|
||||||||
Symlinking
|
The oh-my-zsh deployment clones or downloads the robbyrussell/oh-my-zsh repository into the ~/.oh-my-zsh/ directory.
Having succeeded, it symlinks additional assets into the framework.
The oh-my-zsh framework is installed only by cloning its Github repository.
The included installation script (which normally adds initialization commands to the ~/.zshrc runcom) is not executed, because the current bundle already includes necessary initialization commands.
A blank example file is provided for the custom plugins:
-
plugins/divine/divine.plugin.zsh
A working minimalistic theme is provided for the custom themes:
-
themes/laidbare.zsh-themeThis theme is also defaulted to in the provided initialization commands.
The oh-my-zsh deployment depends on the config-shell deployment (included in the current bundle).
The retrieved oh-my-zsh framework is initialized from the runcom script at ~/.grail/assets/config-shell/01-oh-my-zsh.zsh.
The same file may and should be used to customize the oh-my-zsh framework’s loadout.