Dotfiles and Custom Images

What would be the best way to integrate dotfiles and custom images?

I’m trying to create a sway image with dotfiles, but the solution I found to deal with this may not be better, I’m dealing with the dotfiles directly in the image instead of having a script that clones a git repository and copies the files to the user’s home on the first boot, what would be the best solution in this case? I thought about using chezmoi together with yafti, but I don’t know if that will work

How would you feel about adding a custom justfile command (or, for a more automated experience, a systemd user service running a custom script) which ensures that you have the latest version of your dotfiles, e.g. applied with chezmoi?

I just put mine in /usr/etc/skel. It’s not always updated though - skel is only copied at user creation, so I still need to periodically copy my files to my repo.

The other thing that I’ve been doing is putting my files in my home-manager repo, and using tmpfiles to symlink them so that the files in the local repo is always updated and I just need to commit and push them to GH repo.

1 Like

If someone wanted to do a completely automated chezmoi setup I would ship that by default in Bluefin! It’d be nice to just have this ootb.

2 Likes

That would be cool and would help a lot

Opened an issue about this in blue-build/modules:

Please check out this pull request for this feature.

1 Like

How do you deal with the dotfiles directly in the image ? i am having difficutly doing that, it seems it doesn’t want to go to .config, can you share something please.

Would this still be interesting? Bluebuild’s implementation seems pretty nice, I could port it over to Bluefin quite easily following their steps. I personally dont know if it would be super cool to mess around with people’s $HOMEs tho…

If you are using BlueBuild just use their module, otherwise it is kind of a complicated implementation to figure out if you havent done something like that already

Yes I am using bluebuild, can you be more specific please because I tried to set it up in their recipe file if it is what you mean and also I tried with a script but I don’t get the result I want which is simply to copy my dotfiles into the .config folder but I can copy them elsewhere for some reason which may not be very useful.

Stuff you put into /etc/skel gets copied to a new user’s $HOME automatically. Put your dotfiles in there

1 Like

Thanx for your answer, I will try that.

I did as you said, put the dotfiles in the etc/skel/.config folder and added the source and destination in the modules of the recipe then created a new user on my laptop and after rebooting all the dotfiles got copied at the right place.
Thank you very much !