kergoth / dotfiles

Primary dotfiles & scripts repository
Other
20 stars 1 forks source link

Generate tool integration shell fragments with chezmoi #5

Open kergoth opened 10 months ago

kergoth commented 10 months ago

See Optimizing Shell Startup Time, the main idea being to call out to them in templates, such as {{ output "/opt/homebrew/bin/brew" "shellenv" | trim }}. There are items to confirm when looking into this approach. We'd have to ensure that changes to the packages result in changing the template, and package installation would have to be done with a before script to ensure they're available for the templates to use. They would also have to not depend on my user PATH changes.

kergoth commented 6 months ago

The biggest issue with this approach is ensuring the availability of the tools which are installed in the home directory at the time of chezmoi application. They can be installed in a before_ script, but we may well need certain config files to be installed before they can be installed, such as is the case with nix home manager. I don't believe chezmoi's locks allow for a before_ script to partially apply a chezmoi config, but there's potential to leverage chemzoi execute-template for this in the before_ script instead.