Skip to content

mcereda/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

Personal dotfiles for better host management and more fun!

License

The MIT license is used here, see LICENSE.

Status

Development is always ongoing. Changes will be made when I need them.

Support

Aaahm… Well… Nope.

Installation

It expects one to manage the repository as packages using GNU stow:

$ stow --target $target_dir --dotfiles $package_list

# simulate
$ stow --target $HOME --verbose common git linux vim zsh --dotfiles --simulate
…
LINK: .screenrc => Repositories/Private/dotfiles/screen/.screenrc
LINK: .vimrc => Repositories/Private/dotfiles/vim/.vimrc
WARNING: in simulation mode so not modifying filesystem.

Usage

Most files are prefixed by numbers and managed the same way linux does with /etc/profile and /etc/profile.d:

  1. the files are listed the default globbing behaviour in shells is to list files alphabetically
  2. the files are sourced from the list above in FIFO style
$ tree -a zsh
zsh
├── .zshrc.d
│   ├── 00-home.env
│   ├── …
│   ├── 70-gcp-prompt.zsh
│   └── gitlab.zsh
├── .zshenv
└── .zshrc

$ cat zsh/.zshrc
…
  for module in ${zsh_modules_dir}/*
  do
    [[ -r ${module} ]] && source "${module}"
  done
  unset module
…

To achieve the expected result:

  • environment variables should use default values, and override them only when needed:

    antigen theme ${ANTIGEN_THEME:-gentoo}
  • the files' numbered prefix should follow a structured priority:

    1. generic environment customizations (personal, work, …)
    2. os-related overlays and customizations (darwin, linux, …)
    3. package managers customizations (brew, macports, …)
    4. frameworks configuration and activation (antigen, zplug, …)
    5. shell customization (bash, zsh, …)
    6. app overlays (git, minikube, …)
    7. aliases and functions
    8. prompt customization

This should ensure nice, subsequent overrides of variable values and settings.

I personally suggest to keep all shared resources in one place putting them under the ${package}/.local/share/${package} folder and sourcing them inside a package's files:

$ tree -a zsh/.local/share/zsh
zsh/.local/share/zsh
└── zplug
    └── init.zsh

2 directories, 1 files

$ cat zsh/zshrc.d/zplug/9-init
source ${ZPLUG_HOME:-~/.local/share/zsh/zplug}/init.zsh

Contributing

This repository is not open for contributions, but I might accept suggestions. Please use the repository's hosting platform's tools for this.

Further readings

Sources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published