chezmoi and radicle.xyz

Written on by j23n in chezmoi radicle log

Using chezmoi init in combination with a radicle remote, e.g. chezmoi init rad://z3NeeQp2CXTkNRGba6gni1C8s4nSx doesn't work. Chezmoi runs a plain git clone through the helper - this seems to set up fetching correctly but fails for push:

error: no public key given as a remote namespace, perhaps you are attempting to push to restricted refs

The issue is that rad clone sets a separate pushurl that includes the local node's public key (NID) as a namespace - rad://<RID>/<NID> - while a plain git clone only sets the fetch URL rad://<RID>.

You can fix this by manually setting the pushurl for the repo:

$ chezmoi cd
$ NID=$(rad node status --only nid)
$ git config remote.origin.pushurl rad://<RID>/$NID

Or, you could also clone the repo first and then point chezmoi at it:

$ rad clone rad:<RID> ~/dev/dotfiles
$ chezmoi init --source ~/dev/dotfiles --apply