backups for hs
This commit is contained in:
parent
675e10b3b8
commit
da075f90ad
2 changed files with 25 additions and 0 deletions
24
os/hs/backup.nix
Normal file
24
os/hs/backup.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.borgbackup.jobs =
|
||||||
|
let
|
||||||
|
basicBackup =
|
||||||
|
path:
|
||||||
|
let
|
||||||
|
name = baseNameOf path;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
paths = path;
|
||||||
|
encryption.mode = "none";
|
||||||
|
repo = "/disk1/backup/${name}";
|
||||||
|
compression = "auto,zstd";
|
||||||
|
startAt = "daily";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
immich = basicBackup "/var/lib/immich";
|
||||||
|
syncthing = basicBackup "/var/lib/syncthing";
|
||||||
|
forgejo = basicBackup "/var/lib/forgejo";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ in {
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./disks.nix
|
./disks.nix
|
||||||
|
./backup.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings = { experimental-features = [ "nix-command" "flakes" ]; };
|
nix.settings = { experimental-features = [ "nix-command" "flakes" ]; };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue