Managing all my dotfiles with single file
I wanted to write a blog post, but in fact just go read the source here: paquiteau/dotfiles
1. Some inspiration:
I am not the inventor or the sole user of this paradigm to manage my dot files, you may found interesting setup there:
- https://web.archive.org/web/20190924102437/https://expoundite.net/guides/dotfile-management
- https://github.com/search?q=language%3A%22Org%22%20dotfiles&type=repositories
- farlado/dotfiles
- lgfang/dotfiles
- ivoarch/.dot-org-files
- pniedzielski/dotfiles-ng
- https://writepermission.com/introducing-literate-dotfiles.html
- https://github.com/mitchty/dotfiles/tree/org-mode-all-the-things
- https://news.ycombinator.com/item?id=44812611
2. A few highlights
2.1. Tangle to a tramp remote (to deploy dotfiles remotely):
(defun tangle-remote (name)
"Tangle a org-src block to a remote file, using TRAMP"
(if (file-remote-p (buffer-file-name))
(let* ((tramp-con (tramp-dissect-file-name (buffer-file-name)))
(tramp-home (tramp-get-home-directory tramp-con))
(tramp-host (tramp-file-name-host tramp-con)))
(expand-file-name (format "/sshx:%s:%s/%s" tramp-host tramp-home name)))
(expand-file-name name (getenv "HOME"))
)
)
2.2. Deployment script
git clone git@github.com:paquiteau/dotfiles.git
emacs --batch -Q -l org --eval '(org-babel-tangle-file "config.org")'