From 6bedd27dea52cd5a3fc325369eaec4fdd36fce68 Mon Sep 17 00:00:00 2001 From: Nettika Date: Fri, 12 Jul 2024 23:21:24 -0700 Subject: [PATCH] Configure secrets for restic backup --- marauder/backup.nix | 10 +++++++++- secrets.json | Bin 25 -> 209 bytes 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/marauder/backup.nix b/marauder/backup.nix index b4637ab..58c2213 100755 --- a/marauder/backup.nix +++ b/marauder/backup.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, secrets, ... }: { environment.systemPackages = with pkgs; [ restic @@ -24,6 +24,14 @@ }; }; + environment.etc = { + "restic-env".text = '' + export B2_ACCOUNT_ID="${secrets.b2.accountId}" + export B2_ACCOUNT_KEY="${secrets.b2.accountKey}" + ''; + "restic-password".text = secrets.restic.password; + }; + services.restic.backups = { b2 = { initialize = true; diff --git a/secrets.json b/secrets.json index e4aa2b220cd0be13fdfd18af66712f7e292b8826..354060a1b2be713c3decbb282d7aed632d278f41 100644 GIT binary patch literal 209 zcmZQ@_Y83kiVO&0*gKt*ZRMoE%Qw8Xr_48EkgTi^cbYqQ*7db6H~SY{cQsoT?4>2W zqUYic)0QQ2i;o|6mEzE@vv0rlJtrqoVavrHRj#KJ zEUBHnk**Q8<)+nQ@hKULCf=UEu_;i9|B630(X_}mNt#Fk{z literal 25 hcmZQ@_Y83kiVO&0u=%%>n>%zb+vM^+>(9j>0|04M3IG5A