Skip to content

A minimalistic Linux dotfile management tool stowing dotfiles, installing packages and executing bash scripts - controlled by one or more simple ~INI~ files.

Notifications You must be signed in to change notification settings

echjansen/pure-dotfiles

Repository files navigation

= P U R E - D O T F I L E S =

What is this

Pure-dotfiles is dotfile deployment tool, utilizing existing linux tools, bringing them together in one (or more) simple INI files. Pure-dotfiles takes care of installing dotfiles (using stow), installing the packages associated to your dotfiles (using yay), enables services (using systemctl) and execute bash scripts (using bash). The result is a completely installed system.

key features

The key features of the project include:

  • Dotfiles are managed with Gnus stow
  • An install file that process script INI files, taking care of:
    • Installation of pacman packages
    • Installation of AUR packages
    • Enabling and starting of systemctl services
    • Executing of bash commands
  • A log file is created for each run of the install script
  • Multiple INI files can be provided to the installer.

Note that by maintaining multiple INI files selective or partial installation if larger features, such as desktops, Emacs environment, etc becomes possible.

Installation of pure-dotfiles

Installation:

# Install the minimum requirements
pacman -S stow
# Clone your dotfile repository
git clone https://github.com/echjansen/pure-dotfiles ~/dotfiles
# Install packages, services, scripts, etc
python install.py install/core install/email

Stow works on the principle that it stows all packages in the parent folder of the dotfile folder. In case the dotfile folder is located in a sub folder, stow can be informed about the dotfile folder with the -d option.

Use an alias for stow when the dotfile folder is located in a sub directory:

# Allow the repository to be located anywhere
# -vv        : verbose with more detail (can also be -vvv)
# -R         : revert earlier stows
# -d         : full path tho the dotfiles repository
# -t         : full path to the target
# --ignore   : ignore any file / folder regardless where located
alias stow='stow -vv -R -d ~/Projects/pure-dotfiles/ -t ~/ --ignore=.install.sh'

Usage examples:

stow */                         # Stow all packages
stow emacs                      # Stow the emacs configuration (only)
python install.py init-file     # Install packages, services and run final commands

User configuration

The user configuration files are classical INI files.

  • They provide sections identified by [...] brackets. Each section has a pre-defined behaviour (but could be extended easily):
    1. [pacman] - Installation of packages using the pacman tool (Arch Linux)
    2. [aur] - Installation of packages using the yay tool
    3. [service] - Enables and starts systemctl services
    4. [script] - Executes bash commands lines

An example of a installation INI file:

[pacman]
editor = emacs-wayland
terminal = foot
security = gnupg openssh yubikey-manager
versioning = git gitui
filemanager = ranger
utils = btop htop

# Install package list from aur
[aur]

# Services to be enabled and started
[service]
network = NetworkManager

# Bash commmands to be executed
[script]
# Create mail directory (mbsync)
create maildir user1 = mkdir -p ~/.mail/user1
# Stow packages
Configure all = stow */
Configure bash = stow bash
Configure emacs = stow emacs

An example of the output of running the installation script:

>> [ DONE ] Checking if AUR helper exists.
>> [ DONE ] Refreshing pacman database cache.
>> [ INFO ] Installing archlinux package(s):.
>> [ DONE ] Installing ['editor']: emacs
>> [ DONE ] Installing ['terminal']: foot
>> [ DONE ] Installing ['email']: isync msmtp
>> [ DONE ] Installing ['security']: gnupg openssh yubikey-manager
>> [ DONE ] Installing ['versioning']: git
>> [ DONE ] Installing ['filemanager']: ranger
>> [ DONE ] Installing ['utils']: htop
>> [ INFO ] Installing AUR package(s):.
>> [ DONE ] Installing ['email']: mu
>> [ INFO ] Enabling and Starting service(s):.
>> [ DONE ] Enabling network: NetworkManager
>> [ DONE ] Starting network: NetworkManager
>> [ INFO ] Executing bash script(s):.
>> [ DONE ] Executing mkdir -p ~/.mail/franz
>> [ DONE ] Executing mkdir -p ~/.mail/jansen
>> [ DONE ] Executing mkdir -p ~/.mail/web
>> [ DONE ] Executing mbsync -a
>> [ DONE ] Executing mu init --maildir=~/.mail '--my-address=user@email.com'
>> [ DONE ] Executing mu index
>> [ INFO ] Check ~/tmp/install.log~ for full installation output.

An example when there is no internet connection.

>> [ DONE ] Checking if AUR helper exists.
>> [ FAIL ] Refreshing pacman database cache.

About

A minimalistic Linux dotfile management tool stowing dotfiles, installing packages and executing bash scripts - controlled by one or more simple ~INI~ files.

Topics

Resources

Stars

Watchers

Forks