How to replicate dotfiles across qubes?

I might be in the process of devising a solution for my use case. I am making use of git bundle command. See here for an introduction: Git - Bundling

As I keep testing this workflow, I will straighten the kinks and if I am satisfied with it, probably will write a full guide. But for now, here’s some quick notes on it:

Syncing dotfiles across qubes without a remote server on the internet:

on the dotfiles qube:
cd into ~/.dotfiles dir.
You already have a git repo in there. You have your dotfiles organized according to stow program.
~/.dotfiles/zsh/.config/zsh/ → this dir contains your zsh dotfiles.

So, on ~/.dotfiles dir:
$ git bundle create dotfiles.bundle HEAD master

this will create a dotfiles.bundle file containing the version of ~/.dotfiles directory as it is on the dotfiles qube.

You then qvm-move that dotfiles.bundle into another qube that you want to propagate your dotfiles to.

Let’s say you qvm-move 'd that file to “mydebian” qube. On the mydebian qube, create the ~/.dotfile dir. Then, move the dotfiles.bundle file there:

$ mv ~/QubesIncoming/dotfiles/dotfiles.bundle ~/.dotfiles

Then, cd into ~/.dotfiles dir and do

$ git pull dotfiles.bundle

You will have the same dir with the same git history and files as in dotfiles qube now in your mydebian qube.

Let’s say, you change some files in ~/.dotfiles, in this mydebian qube, and you want to propagate those changes back to the dotfiles qube. You commit your changes, and create a git bundle in mydebian:

$ git bundle create dotfiles.bundle HEAD master

Basically qvm-move that dotfiles.bundle file back to dotfiles qube. Move that bundle file again to the ~/.dotfiles dir, and git pull from it in the dotfiles dir.

You can further assign following git usernames for keeping track of which commits came from which qubes:

(on dotfiles ) $ git config user.name ‘dotfiles’
(on dotfiles ) $ git config user.email ‘dotfiles@localhost’

(on mydebian ) $ git config user.name ‘mydebian’
(on mydebian ) $ git config user.email ‘mydebian@localhost’

that way, your commit history will show the qubes’ names as the commit owners.

1 Like