Closed ProfessorManhattan closed 1 year ago
Interesting project, really pushing chezmoi to the limit :)
I think what you want can be achieved with a template:
{{ if stat "path/to/age/key.txt" -}}
{{ include "path/to/encrypted/file" | decrypt -}}
{{ else -}}
{{ include "path/to/fallback/file" }}
{{ end }}
Hey @twpayne -- yeah... Chezmoi is really cool thanks for making it... it'd be cool if we could make the scripts asynchronous
it'd be cool if we could make the scripts asynchronous
This would make chezmoi very non-deterministic and likely cause a lot of problems due to implicit dependencies between scripts (e.g. a later script needing a package that is installed by an earlier script). You can of course already use concurrency within a single a script, e.g. have a script that runs a number of other scripts in the background and then waits for them all to finish.
Hopefully this is now resolved. Please re-open if needed.
What exactly are you trying to do?
I am trying to allow the user to use
encrypted_
files by default but I would also like to provide an alternate file that is used in place of theencrypted_
file if the Age key is not present on the system.What have you tried so far?
I tried removing the
encrypted_
files and replacing them withencrypted-fallback_
files but it is messy and overly complicated. I'm looking for the "Chezmoi" way of handling it.Where else have you checked for solutions?
Additional context
I have a rather elaborate Chezmoi project and would like to give people the ability to use the project without having to set up encryption beforehand. The project is here: https://gitlab.com/megabyte-labs/install.doctor