Skip to content

chore: split bootstrap config into mise conf.d fragments - #4069

Draft
risu729 wants to merge 1 commit into
mainfrom
chore/split-mise-config-into-fragments
Draft

chore: split bootstrap config into mise conf.d fragments#4069
risu729 wants to merge 1 commit into
mainfrom
chore/split-mise-config-into-fragments

Conversation

@risu729

@risu729 risu729 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Splits the 225-line mise.toml using mise's conf.d fragments (2026.8.13).

Was stacked on #4068 (now merged); rebased onto main and retargeted.

Layout

File Contents Lines
mise.toml min_version, [vars], [tools], [settings], [deps], [task_config], [dotfiles], [hooks] 225 → 81
.config/mise/conf.d/bootstrap-hooks.toml the five [bootstrap.hooks.*] shell blocks 92
.config/mise/conf.d/bootstrap.toml [bootstrap.linux.systemd.units], packages, repos, user 56

This separates the imperative shell from the declarative lists, and keeps the file you edit to bump a tool version short.

Three constraints that shaped this

  1. [dotfiles] had to stay in mise.toml. Dotfile sources resolve against the directory of the config file that declares them (src/system/files.rs:289, and the module docs: "resolved relative to the config file that declares them"). Moving the section would have silently repointed all 14 wsl/home/... sources at .config/mise/conf.d/.

  2. The path must be .config/mise/conf.d/, not mise/conf.d/. mise accepts both, but Renovate's mise manager only matches the former:

    '**/{,.}mise{,.*}.toml', '**/{,.}mise/config{,.*}.toml', '**/.config/mise{,.*}.toml',
    '**/.config/mise/{mise,config}{,.*}.toml', '**/.config/mise/conf.d/*.toml', '**/.rtx{,.*}.toml'
    

    Nothing moved here carries a Renovate-managed version today (the apt: pins are all latest), but this keeps the door open. [vars] stayed put, so the PSScriptAnalyzer jsonata manager, which is anchored to /^mise\.toml$/, is unaffected.

  3. .gitignore needed a negation. The global ignore this repo ships (wsl/home/.config/git/ignore:726) has a *.d rule that excludes conf.d/. Since git cannot re-include a file under an excluded directory, !/.config/mise/conf.d/ is added to the repo .gitignore, which takes precedence over core.excludesFile.

Note

The constraint in point 1 is a mise inconsistency: relative source paths in [dotfiles]/[bootstrap.files] resolve against the declaring config file's directory, while task_config.includes resolves against config_root() — so these sections silently break inside conf.d fragments even though mise knows the fragment's project root. Tracked as a draft item (with a minimal repro) in the mise project: https://github.com/users/risu729/projects/3/views/1?pane=issue&itemId=236320437

Also

Trust is per config file, so wsl/install.sh now runs mise trust --yes --all scoped with --cd instead of trusting mise.toml alone.

Note on [tools]

[tools] deliberately stayed in mise.toml. Lockfiles are placed beside their config, and conf.d entries share the parent's lockfile (src/lockfile.rs:1470-1495), so moving [tools] would relocate the 27KB mise.lock to .config/mise/mise.lock and put it out of reach of Renovate's lockFileNames = ['mise.lock'].

Verification

  • mise run check --lint passes (31 steps).
  • mise config ls shows both fragments loaded.
  • mise bootstrap repos/packages/user status and linux systemd-units status all read the moved content correctly; bootstrap --dry-run still registers the hooks.
  • mise bootstrap dotfiles status confirms all 14 sources still resolve.
  • shellcheck and shfmt pass on wsl/install.sh.

Summary by Sourcery

Split the mise bootstrap configuration into conf.d fragments while preserving existing bootstrap behavior and tooling integrations.

Enhancements:

  • Split mise bootstrap configuration into dedicated conf.d fragments for imperative hooks and declarative bootstrap resources while keeping the main configuration focused and compatible with dotfile resolution and lockfile management.

Chores:

  • Allow the new mise conf.d directory to be tracked despite the repository's global ignore rules.
  • Update the WSL installer to trust all mise configuration fragments from the repository directory.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @risu729, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR reduces mise.toml from 225 to 81 lines by relocating bootstrap hooks and declarative bootstrap data into tracked .config/mise/conf.d fragments, while deliberately retaining sections that control dotfile source resolution, Renovate discovery, and lockfile placement. The installer now trusts all repository-local mise configs, and verification confirms fragment loading and bootstrap behavior remain intact.

Sequence diagram for trusting mise configuration fragments

sequenceDiagram
    participant Installer as wsl/install.sh
    participant Mise as mise
    participant Configs as Repository mise configs

    Installer->>Mise: --cd dotfiles_dir trust --yes --all
    Mise->>Configs: Load mise.toml and .config/mise/conf.d/*.toml
    Mise-->>Installer: All local configs trusted
    Installer->>Mise: --cd dotfiles_dir bootstrap --yes --update --force-dotfiles --locked --skip-dirty
    Mise->>Configs: Read bootstrap hooks and declarative bootstrap data
    Mise-->>Installer: Bootstrap completed
Loading

File-Level Changes

Change Details Files
Split bootstrap configuration into mise conf.d fragments while preserving behavior and config-sensitive paths.
  • Move five imperative bootstrap hook scripts into a dedicated hooks fragment.
  • Move systemd unit, package, repository, and user declarations into a declarative bootstrap fragment.
  • Keep dotfiles, tools, and vars in the main configuration to preserve source resolution, lockfile placement, and Renovate behavior.
  • Add a gitignore exception so the conf.d fragments are tracked.
mise.toml
.config/mise/conf.d/bootstrap-hooks.toml
.config/mise/conf.d/bootstrap.toml
.gitignore
Update installation trust handling for multiple mise configuration files.
  • Trust all mise configs from the repository directory using --cd and --all during repository update and bootstrap.
  • Retain repository-scoped execution for subsequent mise bootstrap commands.
wsl/install.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@risu729
risu729 force-pushed the chore/delegate-repo-update-to-mise branch from ace9c8e to fa4d3f5 Compare August 27, 2026 21:06
@risu729
risu729 force-pushed the chore/split-mise-config-into-fragments branch from fc8614d to f9c7496 Compare August 27, 2026 21:06
Base automatically changed from chore/delegate-repo-update-to-mise to main August 27, 2026 21:11
@risu729
risu729 force-pushed the chore/split-mise-config-into-fragments branch from f9c7496 to 1d1e5f2 Compare August 27, 2026 21:13
Move the [bootstrap.*] sections out of mise.toml into
.config/mise/conf.d/, separating the imperative shell hooks from the
declarative package/repo/user lists. mise.toml drops from 225 to 81
lines and now holds only vars, tools, settings, deps, task_config,
dotfiles, and hooks.

[dotfiles] stays in mise.toml because dotfile sources resolve against
the directory of the config file that declares them, so moving it would
break every wsl/home/... source path.

Trust is per config file, so the installer now trusts the whole config
set with 'mise trust --all' instead of just mise.toml.
@risu729
risu729 force-pushed the chore/split-mise-config-into-fragments branch from 1d1e5f2 to 1a2787d Compare August 27, 2026 21:55
@risu729
risu729 marked this pull request as draft August 27, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant