by iLemming · 7y ago · 0 comments
- install Emacs
- clone my dotemacs repo
- clone dotfiles repo with a single org file (that comprises my entire machine configuration)
- Run M-x org-babel-tangle. That "extracts" all the dotfiles - gitconfig, bash settings, mail, environment variables, language specific settings. Depending on the machine, either Linux or OSX specific settings, etc.
See, my entire machine configuration is an immutable thing - whenever I need to make changes I'd do it in my .org file and run org-babel-tangle.
#+begin_src gitconfig :tangle ~/.gitconfig
You can even do it for different systems like so:
#+begin_src gitconfig :tangle (when (eq system-type 'darwin) "~/.gitconfig")
if you need file to be tangled in nested dirs you can add this header:
:mkdirp yes
if you need the content to be encrypted:
#+begin_src emacs-lisp :tangle ~/.authinfo.gpg :mkdirp yes # -- epa-file-encrypt-to: ("your-email@email.com") -- #+end_src