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

22 lines
533 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>;
paths = [
"/home/kfm/work"
];
};
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
}