Skip to content
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

Add {MISE_CONFIG_DIR}/config.{MISE_ENV}.local.toml to config lookup #2773

Closed
Drew-Daniels opened this issue Oct 17, 2024 · 0 comments · Fixed by #2783
Closed

Add {MISE_CONFIG_DIR}/config.{MISE_ENV}.local.toml to config lookup #2773

Drew-Daniels opened this issue Oct 17, 2024 · 0 comments · Fixed by #2783
Labels
enhancement New feature or request

Comments

@Drew-Daniels
Copy link

I have set MISE_CONFIG_DIR to ~/projects/dotfiles/mise and have a config.local.toml file with global env vars that I want to make available to all my shells.

However, I see that this file is not getting loaded, and it doesn't look like this file is included in the mise file lookup process, at least as far as I can tell by looking at the documentation on Profiles.

I host my dotfiles on a remote GitHub repository, and have a mise/config.toml file that I have committed with settings I want to share across machines, but I would like to also have a mise/config.local.toml file that I do not track that can hold all of my secrets & machine-specific configurations, and while it looks like this is supported if you have config.local.toml in a directory like ~/.config/mise, it doesn't look like you can if you're setting MISE_CONFIG_DIR to some other directory.

My .zshrc (with XDG_CONFIG_HOME set to ~/projects/dotfiles):

# mise
export MISE_CONFIG_DIR="$XDG_CONFIG_HOME/mise"
# development, testing, production
export MISE_ENV="development"
eval "$(/opt/homebrew/opt/mise/bin/mise activate zsh)"

export MISE_RUBY_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-gems"
export MISE_NODE_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-npm-packages"
export MISE_PYTHON_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/mise/.default-python-packages"
❯ mise doctor
version: 2024.10.7 macos-arm64 (2024-10-14)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 14 Oct 2024 22:13:17 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04) (Homebrew)
  Profile: release

shell:
  fish
  fish, version 3.7.1

dirs:
  data: ~/.local/share/mise
  config: ~/projects/dotfiles/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/projects/dotfiles/mise/config.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  node  https://github.com/asdf-vm/asdf-nodejs#c36e6f0

toolset:
  [email protected]
  [email protected]
  [email protected]
  [email protected]  (missing)
  [email protected]      (missing)
  [email protected]
  [email protected]      (missing)
  [email protected]

env_vars:
  MISE_SHELL=fish
  MISE_NODE_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-npm-packages
  MISE_CONFIG_DIR=~/projects/dotfiles/mise
  MISE_ENV=development
  MISE_PYTHON_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-python-packages
  MISE_RUBY_DEFAULT_PACKAGES_FILE=~/projects/dotfiles/mise/default-gems

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cache_prune_age = "30d"
  ci = false
  color = true
  debug = false
  disable_backends = []
  disable_default_registry = false
  disable_hints = []
  disable_tools = []
  experimental = true
  fetch_remote_versions_cache = "1h"
  fetch_remote_versions_timeout = "10s"
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = "60"
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  yes = false

  [cargo]
  binstall = true

  [node]

  [pipx]
  uvx = false

  [python]
  default_packages_file = "~/.default-python-packages"
  pyenv_repo = "https://github.com/pyenv/pyenv.git"
  venv_auto_create = false
  venv_stdlib = false

  [ruby]
  default_packages_file = "~/projects/dotfiles/mise/default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

TLDR

We have a lookup for {MISE_CONFIG_DIR}/config.{MISE_ENV}.toml, I would like mise to also lookup {MISE_CONFIG_DIR}/config.{MISE_ENV}.local.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant