Help with Chezmoi module
Hello all, I'm so grateful for all the work that has been done on this project and my experience so far has been fantastic.
I'm trying to set up the chezmoi module and for the life of me can't seem to get it to play ball. This is in my recipe.yml:
- type: chezmoi
repository: "https://github.com/sgbonney/dotfiles"
file-conflict-policy: replace # override changed files with those from the repo
It's pretty bare at the moment, testing in a VM to see if it all works. Chezmoi is being installed however the repo isn't being pulled down. I have tried running 'systemctl chezmoi-init.service' and 'systemctl chezmoi-update.timer' they both return that the unit could not be found.
I'm at a bit of a loss as to what to do next or what I may be doing wrong. If anyone has any advice or can point me in the correct direction it would be really appreciated.
6 Replies
i'm not sure if this is a problem in the commands you've run and in your recipe too, or just on this discord message, but you're missing dashes between words in many places
i.e.
systemctl enable --user chezmoi-init.service chezmoi-update.timer
and file-conflict-policy
Thank you for your response. I have run systemctl status --user chezmoi-init.service which shows a failure and in the log it states that 'Remote branch null not found in upstream origin', the dotfiles repo has only the main branch.
Thank you for your patience and help so far.
- type: chezmoi
repository: https://github.com/sgbonney/dotfiles
branch: main
file-conflict-policy: replace # override changed files with those from the repo
Specifying the branch and it's all working great, posting here that it may help someone else. Once again thank you for all your help, take care.
np, glad you figured it out
I think that's just a workaround, chezmoi should use the default branch by default.
There is some bug in how empty
INIT_BRANCH_FLAG=""
is passed if branch isn't included in the recipe, instead of just not being passed at all in the chezmoi-init.service
Will fix it when I get free@quotationhill Fixed the issue now, so you can delete the
branch
key now in recipe if you wish
https://github.com/blue-build/modules/commit/a166afed8afa2ea6f30c446aec7f4b4d07d3cff1GitHub
fix(chezmoi): Properly use default branch · blue-build/modules@a166...
yq
outputs "null" string when no results are found, so it's not an empty string.
Branch "null" is passed as custom branch, which very likely doesn&a...Makes sense, thank you