chezmoi icon indicating copy to clipboard operation
chezmoi copied to clipboard

Allow `.chezmoiscripts` to live out of the home directory

Open Larandar opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Scripts that don't depend on a directory are expected to be in the .chezmoiscripts folder. This folder is often hidden by editors and would ideally live outside the root dir.

Describe the solution you'd like

Currently, chezmoi supports a .chezmoiroot file to set a subdirectory as the root of the chezmoi target (cf. https://github.com/twpayne/dotfiles); similarly, it would be good to have the possibility to have .chezmoiscripts file at the same level that indicates a different directory to use.

In such a directory, any file without the prefix run_ would be ignored to facilitate the reusability of code.

Describe alternatives you've considered

  • Merging .chezmoiroot, .chezmoiversion and proposed file into a new .chezmoi.toml that could be extended in the future without creating new . files

Larandar avatar Nov 20 '22 14:11 Larandar

Thanks for this proposal. This makes sense. I propose to address this in chezmoi v3.

twpayne avatar Feb 26 '23 19:02 twpayne