Open JasonYao opened 6 years ago
brew list
command a lot, which is a really slow operation. Instead, we should cache this value from the first time we run it, and then check for existence within that cached valuedotfiles install <some link to a config file somewhere>
ini
file that gets read-in by configparser..load()
, from which it will load in a json file. Adding in support for YAML can then be a thing afterwards, and the Configuration object will be a nice interface for accessing configuration values.The new dotfiles repo's structure should be something like:
.
├── CHECKLIST.md
├── LICENSE
├── README.md
├── start-opinionated <- Bootstrap script that will install pyenv and good environments, then call the start script
├── start <- Bootstrap script that will install via a pre-installed python 3 environment
├── pydotfiles <- Package for the pydotfiles library
│ └── Actual code for pydotfiles that installs the dotfiles
└── git <- contains a directory of git scripts
└── pre-push <- script to run before every push
curl -s https://raw.githubusercontent.com/JasonYao/pydotfiles/master/start-opinionated | bash -s {CONFIGURATION_REPO_GIT_LINK}
# e.g.
curl -s https://raw.githubusercontent.com/JasonYao/pydotfiles/master/start-opinionated | bash -s git@github.com:JasonYao/dotfiles.git
pip install pydotfiles
pydotfiles install {CONFIGURATION_REPO_GIT_LINK}
# e.g.
pydotfiles install git@github.com:JasonYao/dotfiles.git # Git repo containing a config.json or config.yaml
# Updates all dependencies via the host package manager
pydotfiles update
# Cleans out the dotfiles cache and the package manager cache
pydotfiles clean
# Uninstalls all modules
pydotfiles uninstall all
# Uninstalls specific modules
pydotfiles uninstall git # Uninstalls git settings
pydotfiles uninstall ssh # Uninstalls SSH settings
pydotfiles uninstall defaults # Uninstalls host settings to factory defaults
pydotfiles uninstall dependencies # Uninstalls dependencies via host package manager
pydotfiles uninstall env # Uninstalls environment managers like rbenv, jenv, pyenv
pydotfiles uninstall terminal # [MacOS only] Uninstalls the terminal and its settings
I'll stick the new code in a new repo and mark this one as deprecated when I'm done.
Requirements
Basically, this is to list out what I'm trying to do for my new set of dotfiles
Possible Approaches
With that in mind, one way to do it would be as a python package that I'd publish to pypi. It'd have the extra benefit of teaching me everything i need to publish my own python libraries in general, and have it be widely available whenever I need it.
The question really is what to do about applications and libraries that need to be installed. Possible way to break it down:
Commands to contain:
~/.dotfiles/config.ini
General Flow
init
bash script. This should install the bare basics that only need to be installed once (x-code tools, brew, etc.). After setting up foundational stuff, it should install themodern-dotfiles
(or whatever the python package is called) into thelaptop-3.6.3
pyenv environment, and then calldotfiles install --all