creativeprojects / resticprofile

Configuration profiles manager and scheduler for restic backup
https://creativeprojects.github.io/resticprofile/
GNU General Public License v3.0
669 stars 31 forks source link

allow inherit in copy? #147

Closed sedlund closed 1 year ago

sedlund commented 1 year ago

looking to do something like this:

password:
  password-file: pass.txt

local:
  inherit: password
  repository: ~/backups/restic

remote:
  inherit: password
  repository: s3:https://minio.myserver.com/restic
  env:
    AWS_ACCESS_KEY_ID: 000
    AWS_SECRET_ACCESS_KEY: FFF

default:
  inherit: local
  backup:
    source: ~/
    exclude-file: excludes.txt
  copy:
    inherit: remote

or is there a better way to do this?

Thanks for the cool project!

sedlund commented 1 year ago

I tried to do this with templates, but of course this makes the file not valid yaml any longer which makes the LSP blowup. Then finding that the indentation of the template definition matters when it is rendered in different scopes made it a no go.

Then I found the new mixins and it was the answer to all the worlds problems!

Thank you so much.

creativeprojects commented 1 year ago

Hi,

Yes, templates were more suited for TOML file format where there's no concept of indentation. => mixing are definitely better for YAML.

Glad you find the project useful 👍🏻