From 47d63f2fcfb6c84f0cc655d4c1ca94f024f1bb97 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 13 Jul 2022 18:16:02 +0300 Subject: [PATCH] Fix restic password init. --- api/api-module.nix | 14 -------------- api/api.nix | 2 -- backup/restic.nix | 7 ------- files.nix | 2 +- variables-module.nix | 8 -------- variables.nix | 2 -- 6 files changed, 1 insertion(+), 34 deletions(-) diff --git a/api/api-module.nix b/api/api-module.nix index 9ee6fb5..8ae3c59 100644 --- a/api/api-module.nix +++ b/api/api-module.nix @@ -31,18 +31,6 @@ in Enable Swagger UI ''; }; - b2AccountId = mkOption { - type = types.str; - description = '' - B2 account ID - ''; - }; - b2AccountKey = mkOption { - type = types.str; - description = '' - B2 account key - ''; - }; b2Bucket = mkOption { type = types.str; description = '' @@ -66,8 +54,6 @@ in PYTHONUNBUFFERED = "1"; AUTH_TOKEN = cfg.token; ENABLE_SWAGGER = (if cfg.enableSwagger then "1" else "0"); - B2_ACCOUNT_ID = cfg.b2AccountId; - B2_ACCOUNT_KEY = cfg.b2AccountKey; B2_BUCKET = cfg.b2Bucket; RESTIC_PASSWORD = cfg.resticPassword; } // config.networking.proxy.envVars; diff --git a/api/api.nix b/api/api.nix index ff4da06..0c18686 100644 --- a/api/api.nix +++ b/api/api.nix @@ -4,8 +4,6 @@ enable = true; token = config.services.userdata.api.token; enableSwagger = config.services.userdata.api.enableSwagger; - b2AccountId = config.services.userdata.backblaze.accountId; - b2AccountKey = config.services.userdata.backblaze.accountKey; b2Bucket = config.services.userdata.backblaze.bucket; resticPassword = config.services.userdata.resticPassword; }; diff --git a/backup/restic.nix b/backup/restic.nix index 5e5cad0..55dd939 100644 --- a/backup/restic.nix +++ b/backup/restic.nix @@ -26,11 +26,4 @@ in isSystemUser = true; group = "restic"; }; - environment.etc."restic/resticPasswd".text = '' - ${cfg.resticPassword} - ''; - environment.etc."restic/s3Passwd".text = '' - AWS_ACCESS_KEY_ID=${cfg.backblaze.accountId} - AWS_SECRET_ACCESS_KEY=${cfg.backblaze.accountKey} - ''; } diff --git a/files.nix b/files.nix index 0af40fe..4236811 100644 --- a/files.nix +++ b/files.nix @@ -54,7 +54,7 @@ in chmod 0400 /root/.config/rclone/rclone.conf chown root:root /root/.config/rclone/rclone.conf - cat /etc/nixos/userdata/userdata.json | jq -r '.resticPassword' > /var/lib/restic/pass + cat /etc/nixos/userdata/userdata.json | ${jq} -r '.resticPassword' > /var/lib/restic/pass chmod 0400 /var/lib/restic/pass chown restic /var/lib/restic/pass ''; diff --git a/variables-module.nix b/variables-module.nix index 0d5b056..c14fe2c 100644 --- a/variables-module.nix +++ b/variables-module.nix @@ -96,14 +96,6 @@ in description = "Bucket name used for userdata backups"; type = types.nullOr types.str; }; - accountId = mkOption { - description = "Backblaze B2 Account ID"; - type = types.nullOr types.str; - }; - accountKey = mkOption { - description = "Backblaze B2 Account Key."; - type = types.nullOr types.str; - }; }; cloudflare = { apiKey = mkOption { diff --git a/variables.nix b/variables.nix index 81a9283..f163bf5 100644 --- a/variables.nix +++ b/variables.nix @@ -21,8 +21,6 @@ in }; backblaze = { bucket = lib.attrsets.attrByPath [ "backblaze" "bucket" ] "" jsonData; - accountId = lib.attrsets.attrByPath [ "backblaze" "accountId" ] "" jsonData; - accountKey = lib.attrsets.attrByPath [ "backblaze" "accountKey" ] "" jsonData; }; cloudflare = { apiKey = lib.attrsets.attrByPath [ "cloudflare" "apiKey" ] "" jsonData;