-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
[FEATURE] OS specific profiles #229
Comments
Actually I am working on a complete rework off the template system on #213.
I would advice against implementing default os profiles before this is merged since this is a breaking change. This would be way easier to implement and would allow to write os specifics is the same template like so :
Would this solution work for you or would you still need need os profiles ? The PR is almost done, I am actually using it in my current setup. But it involves rewriting the doc entirely. |
That sounds really nice. Was hoping that at some point the template context would be extended to allow for whole structs. This solves half my problem. What still remains is, that I sometimes need a different template target location, based on the OS 🤔. A small suggestion for the above {% if os.linux %}
font-size: 20px;
{% else if os.macos %}
font-size: 30px;
{% endif %}
|
Hi, Is this available for Windows too? Thanks! [ I decided to ask here instead of opening a new issue.] |
I am not sure why you'd want to use toml-bombadil on Windows. Note that this is not implemented yet. |
I see. I was essentially looking for chezmoi implemented in rust, and rust being a cross-platform one binary deliverable, I thought I'd ask. Thanks for clarification. |
I’m currently hacking around this by overriding the def 'bombadil link' [] {
^bombadil link -p $nu.os-info.name
} (nushell both has the OS name readily available and allows defining functions overriding subcommands only) but this feature would be a great addition. An alternative for @dnaka91 and my specific problem would be to provide special variables exposing OS-specific directories: #258 |
This feature loses more and more importance for me, actually. I almost exclusively use my Linux system now, and the current workaround is pretty easy. I was thinking to start an implementation for this feature, but I'd probably start on #230 first before I get started on this issue here. |
this is now implemented (see: https://oknozor.github.io/toml-bombadil/guide/templates.html#default-variables) |
very cool! thanks! |
Wait, how do I derive |
This is not possible yet, we probably need another issue for this. |
I mean, this issue is called “OS specific profiles”, which isn’t actually implemented. You need to know if interpolating variables in the |
Is your feature request related to a problem? Please describe.
I'm using toml-bombadil on both Linux and macOS and currently solve differences by having a separate macos profile with different variables and different dot locations.
With #141, I could omit several of those settings (mostly differences in font sizes). But that doesn't cope for different settings locations. For example, for Visual Studio Code the user settings are located in
~/.config/Code/User/settings.json
on Linux, but in~/Library/Application Support/Code/User/settings.json
.It would be great to have some way to define different targets for different OSs.
Describe the solution you'd like
Eventually having some pre-defined profiles that are auto-enabled depending on the OS? That would mean we perhaps have
profile.windows
,profile.macos
and Linux being the default profile. Then, depending on whether Windows or macOS are detected, they'd be automatically be added to the enabled profiles.That would potentially break some templates, as people might already have profiles with the same name. Could get around that by making a special category like
profile.os.*
, to make clear these aren't user-defined profiles, but pre-defined.Describe alternatives you've considered
Nothing else really. My current solution with the
macos
profile works well, but easy to forget to enable the profile.Additional context
A basic idea how the settings could be defined:
The text was updated successfully, but these errors were encountered: