Hi,
What would be the best way to manage dotfiles (~/.config, etc…) in an uBlue image? I want something that automatically updates when user rebase to a new image version, instead of manually copying everytime the system updates.
Thanks.
Hi,
What would be the best way to manage dotfiles (~/.config, etc…) in an uBlue image? I want something that automatically updates when user rebase to a new image version, instead of manually copying everytime the system updates.
Thanks.
Rebasing doesn’t affect your home folder.
https://www.chezmoi.io/ is what I recommend but we don’t have a super strong opinion on what people use.
But as john points out be careful in places where desktops step on each other’s files.
Today I learned. Thanks for sharing this!
Hi, thanks for your response.
I have seen chezmoi but that tool only pulls from a GitHub repo.
I want the dot files live in the same repo as where I build the image, so when users rebase, some process will copy/rsync the file to user’s home folder. This is kind of similar to NixOs, which updates users’s home config every time they change image.
I think you can make an image repo? It shouldn’t be too hard, and I use it to ship my etc files.
I have taken a look at your repo before opening this thread but sadly it doesn’t do what I need.
I want the config in user’s home dir updates on rebase, and the skel folder only updates on user creation.
Yeah, I don’t know. My first thought is to make an /etc/rc script that checks a separate file – just to provide a check to see if the script has been run for the current base – then if it didn’t pass it’ll copy /etc/skel to the curren user home, overwriting their current config.
Idk I can’t think of anything that isn’t jank like that. There is of course Nix with flakes and home-manager, but that’s a whole different can of worms.
I have not used chezmoi as I wrote my own solution when I was still using Fedora WS.
It is a git repo with a script that has logic to create ~/.config dirs and merge things in place like ~/.gitconfig ==> ~/.config/git/config, etc.
I add more to it as I discover things that do not automatically follow XDG but support it if certain things are in place- like emacs and vscode …
So just an idea to compliment chezmoi.
For anyone looking at this thread in the future: I just put files into the skel folder and rsync on every user login. Who cares about overrides /s.
Most tools provide options to have a system level configuration. Usually those are configured in /usr or /etc
That would be the most appropriate place to put configurations made at an image level while per serving user’s ability to override.
Another option instead of of using rsync is to use user tempfiles.d. I do this to populate things in /run, /var, and /home on boot.
I have seen chezmoi but that tool only pulls from a GitHub repo.
On the contrary, it does work with other git hosting service, see Quick start - chezmoi. I’ve used it at work with Azure Repos. Instead of chezmoi init owner/repo, you just specify the URL to your repo.