-
Notifications
You must be signed in to change notification settings - Fork 48
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
Symlink config to multiple locations? #186
Comments
So I'm not sure if this would solve your problem, but just in case it's helpful I've dealt with something similar by having two seperate files and having them both load the same template. Just note that this would mean that the powershell file in each would be dynamically generated and therefore any changes made wouldn't flow back to the original. That may or may not matter to you. If you need help setting this up, just let me know. |
Similar issue and for me here:
I should just move on from vim and wholly onto neovim, but I think there might be other valid use cases for this pattern? EDIT: |
I keep running into other cases where it might be useful to have a configuration file shared across multiple dotter "packages". Today it was because I want the same MPV config for regular mpv-git and for an different mpv distribution that has a different config location. How complex would implementing this feature be? I am guessing there is some architectural reason that this doesn't work out of the box. In toml, a table cannot have duplicate keys (so your example @hartigan43 is invalid toml), but the powershell example in my original post is valid. I would expect that to work, but there must be something that dotter is doing that requires (all?) keys to be unique, regardless of which table they are in? I'm still a Rust beginner, but I will take a look myself when I get the chance. Addendum: A similar restriction requires all variable names to be unique, across all packages. This is actually something that confused me starting out, because I had the (mistaken) assumption that variables would be scoped to packages. |
I encountered this problem with Visual Studio code as I use the However I would really like to see an official feature supporting this. |
I see it's a pretty highly requested feature and I see the uses, but I don't have the time and motivation right now to implement it. There's a couple design restrictions here
I can't think of the top of my head of a satisfying design for how to specify it in the configuration file, and I'm pretty sure the implementation assumes that there's one target per source so it might need some sweeping changes to support this. I'm welcoming PRs on this :) |
Some thoughts on the user configuration side for supporting this feature. # global.toml
# INVALID
[code.files]
vscode = "~/.config/Code/User"
vscode = "~/.config/VSCodium/User" What makes more sense is to scope each app to a seperate package, like this: # global.toml
# OK, cannot deploy both 'vscode' and 'codium' packages (currently)
[vscode.files]
vscode = "~/.config/Code/User"
[codium.files]
vscode = "~/.config/VSCodium/User" I think this is what most people would need. I believe it would be simpler than allowing a list of targets, as that could complicate the specification quite a bit. When a local.toml configuration requests (Consequently, allowing defining packages at the local (untracked) level might be a useful feature) In summary, a proposed # local.toml
packages = ["codium", "vscode"]
# additional overrides can be specified like
[codium.files]
vscode = "~/my/local/location"
[vscode.files]
vscode = ""
# could even specify package level variable overrides...
[vscode.variables]
special_var = "value" |
Environment
0.13.3
Multiple destinations for same package file?
From what I have tried, it doesn't seem like this is possible at the moment. What I am trying to achieve is something like:
with the package folder
pwsh/
looking likeThis works fine if only
"pwsh"
or"powershell"
package is chosen (mutually exclusive, as seen in examples), but I would like to pick both. I want to link the profile.ps1 file to both locations. Is it possible right now? The only potential workaround I could think of is have one profile symlinked to the other in the dotfiles repository. But that could get messy with doubly linked symlinks (which I don't know if it is even possible? Symlink to a symlink?)The error I get is (unsurprisingly):
The text was updated successfully, but these errors were encountered: