Skip to content

Commit

Permalink
feat: Add BorgBase restic backup
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Mar 7, 2024
1 parent ecf1b06 commit 5fb840c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
31 changes: 31 additions & 0 deletions hosts/nuc/backups.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
config,
pkgs,
...
}: let
restic-backup-id = "c351536f-39a4-4725-9d92-04fcb26b6306";
in {
services.restic.backups = {
daily = {
initialize = true;

repositoryFile = config.age.secrets."restic/repo".path;
passwordFile = config.age.secrets."restic/password".path;

user = "emiller";
paths = [
"${config.users.users.emiller.home}/sync"
"${config.users.users.emiller.home}/archive"
];

pruneOpts = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-monthly 12"
];

backupPrepareCommand = "${pkgs.curl}/bin/curl -m 10 --retry 5 https://hc-ping.com/${restic-backup-id}/start";
backupCleanupCommand = "${pkgs.curl}/bin/curl -m 10 --retry 5 https://hc-ping.com/${restic-backup-id}/$EXIT_STATUS";
};
};
}
7 changes: 7 additions & 0 deletions hosts/nuc/secrets/restic/password.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 qm5Skg So4IAYrzEHUSaEwyTNW+q3TxXYO/g50OiE+WIF9KWRM
1dtjz5VSuEYWUB0mnZLaGwvvrKug1MPWcR79+9w5lz8
-> ssh-ed25519 md4GBw MgLArUpKU5aMgV0n543y5yAMzJIXUmuG4sLmIbWMwjk
Z4XEVSh1ZDj9EIRKFmTOhtaZFg+9RmRv0Zymz5K/RiY
--- CBzgnwWGPAoo+6ui3qmm4+qfkqlQMv1oaTr8xN24XVw
������' ���V���KPp��z�n6��pO���!{����bC�K,Mt���@���?h
8 changes: 8 additions & 0 deletions hosts/nuc/secrets/restic/repo.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 qm5Skg Bb9kumEly0W4HMvLKB44eeT41T/fPtmBNwHT66J2RyI
wRUofy07Efs3qWYcJ5e7+6qASffq64YKgWmiLFGweWU
-> ssh-ed25519 md4GBw iMYqcCUxTRPuHL6JWMO/DscvFZwGBUEgLRvAQzOOSiY
UqQxLO51Ev+Tct6fLvWr/yQBaeHRizKrpz/qIeg3pmI
--- LGUu2Ezg38k4Xn9EeaukfmZQLBagpVqBEbRea1dlOz8
A����5����
:o��.��R�DA�f����O�K��J�+0s��!�"�*{jx,�m���(�(���2��m����qTl������Ԃ�I�LPB�� |
7 changes: 7 additions & 0 deletions hosts/nuc/secrets/secrets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let
edmundmiller = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBsb81evtCCcWSZcLbFaXWrAeCWFrPXPjUvjH4ZKbQC edmundmiller";
nuc = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICBPG2vvh8XkVObXANO9/CBfczftZrmpbjg2w5onK/Tv";
in {
"restic/repo.age".publicKeys = [edmundmiller nuc];
"restic/password.age".publicKeys = [edmundmiller nuc];
}

0 comments on commit 5fb840c

Please sign in to comment.