jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.27k stars 219 forks source link

Support for global configuration profiles #1837

Open toupeira opened 3 months ago

toupeira commented 3 months ago

Background

I use my dotfiles on several machines, only some of which I use for software development.

I'd like to have one global configuration for "default" tooling (like FZF), and a development profile for some programming languages and development tools I want to have available globally, outside of a project context.

I tried adding a ~/.config/mise/config.development.toml and setting MISE_ENV=development, and this works fine but only when I'm inside $HOME.

https://mise.jdx.dev/profiles.html only mentions that profiles are looked up in the current directory, so this seems to be by design.

Proposal

Would you consider extending the lookup to $HOME as well? Not sure if this should be behind an opt-in setting, or maybe using a different MISE_GLOBAL_ENV variable.

Also let me know if there's a better way to do what I want. Right now I work around this by using a single config and setting $MISE_DISABLE_TOOLS instead depending on the hostname, but this will be more annoying to manage as I add more plugins.

milas commented 2 weeks ago

I'd love this as well, e.g. for dealing with AWS profiles universally:

~/.config/mise/config.dev.toml

[env]
AWS_PROFILE = "dev"
AWS_REGION = "us-foo-1"

~/.config/mise/config.prod.toml

[env]
AWS_PROFILE = "prod"
AWS_REGION = "eu-bar-1"

~/.config/mise/config.toml

[tasks."aws-whoami"]
run = "aws --region=${AWS_REGION} sts get-caller-identity"

⬆️ would use AWS_PROFILE based on MISE_ENV

jdx commented 2 weeks ago

Seems like a solid proposal from me 👍