-
Notifications
You must be signed in to change notification settings - Fork 178
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
One-time templates/"seed" files #435
Comments
This is an interesting idea. 👍 |
I've been dealing with this concept for years now in my dotfiles. the "right" solution is more complex than that. I think "seed" files are the right desire,but wrong mental paradigm to address this problem. We can't think of this as as "one-time setup", which is what seed files are generally all about. You run them once and never again. We need to think of this as idempotent bootstrap files that can be run as many times as needed, optionally pre/post-configure "new" things, and not screw up "old" things. Issues to considerLet's take it as a given for the following that we have a user with 2+ devices and they're keeping their configs in sync via yadm, and that we're just discussing bootstrap type operations that involve the setup of new tools. Issues that must be addressed / considered
So, with all that in mind, you need a mechanism by which you can add your new shiny package / tool / whatever to your yadm bootstrap functionality, and have it get installed via the correct means, and then optionally configured when you run it on the "other" computer. I think the solution I've been using is a step in the right direction. I'm not proposing this is the solution yadm should use, but putting it out here as inspiration.
If we go back to my original list this solves points 1 - 5. I have a solution for 6 but it's beyond the scope of anything I'm currently hoping for for yadm. To summarizeFor most config things, file presence tests aren't really relevant because yadm (git) already handles that. If a file isn't present it'll just come into existence when you next run The problem is to support the installation and optional configuration of executables. To do this really well we need to consider that there are installations via a package manager and manual installations. I think we should have
I'm thinking that this could be implemented by having a default Users would be expected to use the helper functions and just append the things they need to install to the end of it. If they want to trash them, no big deal. |
note: my prior comment doesn't address @xeruf 's handling of This presumes that there are some systems out there that actually put it somewhere other than Maybe, through the filter of my proposal above, XDG stuff could just be treated as if it were another "package manager" as, for the purposes of this, a "package manager" is just "a thing which installs stuff in a specific manner to a place of its choosing" |
The setting of variables like |
Is your feature request related to a problem? Please describe.
I have some config files which I want to setup initially on a new device (e.g. Musescore config) but then not track the resulting configuration changes, as these will be device-specific.
Describe the solution you'd like
A third option of alternative files/templates, a type of template maybe called "seed", which will simply copy over to the proper filename only if that file does not exist, so
.config/doom/user.el##seed.esh
would be processed into.config/doom/user.el
upon updating only if the latter does not exist.Whether the seeding uses template processors or alternative file conditions I don't really mind.
Describe alternatives you've considered
I currently use the following workaround in my bootstrap:
The text was updated successfully, but these errors were encountered: