1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/backup.nix

27 lines
677 B
Nix
Raw Normal View History

2022-01-18 22:38:28 +01:00
{ pkgs, config, ... }:
let
inherit (import <niveum/lib>) restic;
2022-01-18 22:38:28 +01:00
in
2022-01-18 21:29:30 +01:00
{
services.restic.backups.niveum = {
initialize = true;
inherit (restic) repository;
2022-01-18 21:29:30 +01:00
timerConfig = { OnCalendar = "00:05"; RandomizedDelaySec = "5h"; };
passwordFile = toString <secrets/restic/password>;
2022-01-18 23:36:38 +01:00
extraBackupArgs = [
"--exclude-file=/home/kfm/projects/nixpkgs/.git"
"--exclude=node_modules"
];
2022-01-18 21:29:30 +01:00
paths = [
"/home/kfm/work"
2022-01-18 23:36:38 +01:00
"/home/kfm/projects"
2022-01-18 21:29:30 +01:00
];
};
2022-01-18 22:38:28 +01:00
environment.systemPackages = [
(pkgs.writers.writeDashBin "restic-niveum" ''
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} "$@"
2022-01-18 22:38:28 +01:00
'')
];
2022-01-18 21:29:30 +01:00
}