Home

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

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")'