-
Taking a bit of a tangential jaunt from #414, I had an idea that I'd appreciate community feedback and guidance on. Specifically, how to most efficiently use the output of Let's say I have this TOML file which relies on the existing [GDrive]
type = drive
client_id = {{ hcpVaultSecret "rcloneDriveId" -}}
client_secret = {{ hcpVaultSecret "rcloneDriveSecret" -}}
scope = drive.file
token = {{ hcpVaultSecret "rcloneDriveToken" -}}
root_folder_id = {{ hcpVaultSecret "rcloneDriveRootDir" -}}
use_trash = false
chunk_size = 32M
skip_gdocs = true
stop_on_upload_limit = true
stop_on_download_limit = true
skip_shortcuts = true
skip_dangling_shortcuts = true
[GDCrypt]
type = crypt
remote = GDrive:
password = {{ hcpVaultSecret "rcloneDriveEncryptKey" -}}
password2 = {{ hcpVaultSecret "rcloneDriveEncryptSalt" -}} Is there an efficient way to replace all these with a defined function, let's say it's called ie. [GDrive]
type = drive
client_id = {{ hcpHandler "rcloneDriveId" }} Where in this case This would save repeating onself with If that is possible, how would I define this globally to be used in other files as a helper function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Yes, you can use
|
Beta Was this translation helpful? Give feedback.
Yes, you can use
includeTemplate
for this:Create a file called
hcpHandler
in a.chezmoitemplates
containing:Call this using
includeTemplate
, for example: