-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Best practice for tracking both local and global dotfiles? #246
Comments
If I were you, I would use two separate repos, and have a master repo with these as submodules to quickly import them both to new systems. |
@alexfornuto: Sure, that's an idea. I'm still curious how other people actually do it on their own machines, and what is recommended by the rcm devs. 😄 |
At the moment I have a few global (/etc) configuration files per machine managed by RCM mixed with personal dotfiles. This has the problem that I need to symlink them to their expected locations on /etc by hand. This is not a good solution because of the extra manual work and the issue with the permissions - sometimes they are expected to be owned by root. The solution we discuss here with two RCM repos, one for personal files with your normal user and another for global files with root is also not great because @mike-burns A feature to specify a target folder to |
I suppose you can symlink /etc in /root to have |
TBH I'm not excited about the idea of using rcm for things under I would be open to a PR that allowed the user to specify the target directory. |
Another advantage: allowing the user to specify the target directory lets rcm track dotfiles whose target locations may depend upon the values of environment variables, e.g. I propose three methods for specifying the target: Therefore we achieve the desired result, with rcm-wide and per-dotfile granularities. A wider question: does it make sense to group all meta-files into a single |
It was a mistake for rcm to mix files like it does, but it's a mistake that's in place now. Changing it would be a breaking change and I'm not convinced it's worth it. I like the What's the case for the manifest target file? |
Suppose I wish to have my dotfiles be installed within It is possible with an rcm-wide feature like the Using a manifest This also solves the original question of the thread, again without requiring multiple invocations of rcm per desired location. I created a patch yesterday that implements these three target methods; if you're convinced, I shall submit it shortly. |
Oh wow, interesting. OK. I'll definitely take a look at this PR, but if that Thank you for working on this! |
A new default target can be set using: * A target option in rcrc(5) * -T flag (based on the work in thoughtbot#255) for thoughtbot#246
A new default target can be set using: * A target option in rcrc(5) * -T flag (based on the work in thoughtbot#255) for thoughtbot#246
This is a good feature, IMHO. I am a new rcm user, and while I do not intend to target outside $HOME, specifying a target somewhere under $HOME, such as $XDG_CONFIG_HOME, is indeed important. I currently have some files and some directories under ~/.config/ (sometimes, under ~/.config/.../) that are part of my work environment. Indeed, ability to have separate rcrc for different dotfile directories, with separate TARGET, would be the killer feature. I have too many undotted folders and files I wish to use rcm with, and right now, the way to automate their linking, I either have to use -U manually, or put them into the common (global) rcrc. |
Agreed! Currently I just locally realias |
I apologize if this is outside the scope of this repo. Go ahead and close, if that's the case.
I want to track the configuration files on my pc, and sync them to GitHub. I've been successfully using rcm for this, in a
~/.dotfiles
folder which doubles as a git working copy. But this can't capture global dotfiles very well. And unfortunately, there are some I just can't move to my home dir (like/etc/bluetooth/main.conf
).I know I can set up another dotfiles directory and list it in
DOTFILES_DIRS
, but then I'd need to maintain two separate GitHub repos for this, which seems strange. Storing both global and local dotfiles in the same dir seems to mix up namespaces in a weird way. (Like both/
and~/
are considered root bymkrc
?)I can think of other solutions, but they become increasingly hacky. Is there some established best practice for this scenario? Do people simply maintain two repos? Do they mix namespaces and hope there's never a clash? Do they put multiple dotfile dirs one level below their git working copy?
The text was updated successfully, but these errors were encountered: