twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
12.9k stars 478 forks source link

Possible to ignore all files except those named? #3007

Closed ostrich closed 1 year ago

ostrich commented 1 year ago

What exactly are you trying to do?

I want to sync my PowerShell profile (~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1) and a only couple other files on my Windows machines. I sync lots of other files among my Linux and macOS installations, but I don't want them created in Windows (nor do I want my Windows files created in other OSs). Is there a way to use .chezmoiignore or some other method to do this?

What have you tried so far?

I've considered explicitly listing every synced file inside {{ if eq .chezmoi.os "windows" }} ... {{ end }} and corresponding ne .chezmoi.os "windows" blocks in my .chezmoiignore but that seems like a maintenance headache. I'm afraid my template-fu isn't good enough to figure this out in the absence of a hypothetical .chezmoiallow. I've also considered making a separate dotfiles repo for Windows, but that's not ideal because I still would like to sync e.g. my Neovim configs to Windows.

Where else have you checked for solutions?

Additional context

Thanks for an amazing application.

ostrich commented 1 year ago

Ok, looks like the best solution will be simply to carefully curate .chezmoiignore and ensure I remember to add any new files. Closing.