mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
refactor: move homelab config to module
This commit is contained in:
parent
742a55e5a0
commit
e03f3af01d
19 changed files with 123 additions and 62 deletions
30
modules/homelab/restic.nix
Normal file
30
modules/homelab/restic.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.fireproof.homelab.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
restic
|
||||
];
|
||||
|
||||
age.secrets.restic-password.rekeyFile = ../../secrets/hosts/homelab/restic-password.age;
|
||||
age.secrets.restic-env.rekeyFile = ../../secrets/hosts/homelab/restic-env.age;
|
||||
|
||||
services.restic.backups.homelab = {
|
||||
repository = "b2:fireproof-backup";
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
passwordFile = "${config.age.secrets.restic-password.path}";
|
||||
environmentFile = "${config.age.secrets.restic-env.path}";
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 75"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue