Merge pull request 'Add rclone config creation' (#3) from ilchub-patch-1 into system-configuration

Reviewed-on: #3
pull/4/head
Inex Code 2021-11-30 22:50:38 +02:00
commit 41cbf0f14e
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,12 @@ in
CLOUDFLARE_DNS_API_TOKEN=${cfg.cloudflare.apiKey}
CLOUDFLARE_ZONE_API_TOKEN=${cfg.cloudflare.apiKey}
'';
rcloneConfig = builtins.replaceStrings [ "\n" "\"" "\\" ] [ "\\n" "\\\"" "\\\\" ] ''
[backblaze]
type = b2
account = ${cfg.backblaze.accountId}
key = ${cfg.backblaze.accountKey}
'';
in
[
(if cfg.bitwarden.enable then "d /var/lib/bitwarden 0777 bitwarden_rs bitwarden_rs -" else "")
@ -21,6 +27,7 @@ in
(if cfg.pleroma.enable then "d /var/lib/pleroma 0600 pleroma pleroma - -" else "")
"d /var/lib/restic 0600 restic - - -"
"f /var/lib/restic/pass 0400 restic - - ${resticPass}"
"f /root/.config/rclone.conf 0400 root root - ${rcloneConfig}"
(if cfg.pleroma.enable then "f /var/lib/pleroma/secrets.exs 0755 pleroma pleroma - -" else "")
"f /var/domain 0444 selfprivacy-api selfprivacy-api - ${domain}"
(if cfg.nextcloud.enable then "f /var/lib/nextcloud/db-pass 0440 nextcloud nextcloud - ${nextcloudDBPass}" else "")