sombrero: Add restic module
This commit is contained in:
@@ -72,33 +72,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
|
||||||
restic.backups = {
|
|
||||||
"sync" = {
|
|
||||||
initialize = true;
|
|
||||||
|
|
||||||
user = "alex";
|
|
||||||
|
|
||||||
passwordFile = "/home/alex/backup/restic/password.file";
|
|
||||||
environmentFile = "/home/alex/backup/restic/aws.env";
|
|
||||||
repository = "s3:https://s3.eu-north-1.amazonaws.com/restic-sync-backup";
|
|
||||||
|
|
||||||
paths = ["/home/alex/backup/sync"];
|
|
||||||
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "daily";
|
|
||||||
Persistent = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pruneOpts = [
|
|
||||||
"--keep-daily 2"
|
|
||||||
"--keep-weekly 7"
|
|
||||||
"--keep-yearly 12"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
mutableUsers = false;
|
mutableUsers = false;
|
||||||
|
|
||||||
@@ -124,7 +97,6 @@
|
|||||||
git
|
git
|
||||||
tig
|
tig
|
||||||
unar
|
unar
|
||||||
restic
|
|
||||||
];
|
];
|
||||||
|
|
||||||
config-manager = {
|
config-manager = {
|
||||||
@@ -140,6 +112,7 @@
|
|||||||
plex.enable = true;
|
plex.enable = true;
|
||||||
calibre-web.enable = true;
|
calibre-web.enable = true;
|
||||||
transmission.enable = true;
|
transmission.enable = true;
|
||||||
|
restic.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
|
|||||||
43
hosts/sombrero/modules/restic/default.nix
Normal file
43
hosts/sombrero/modules/restic/default.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
enabled = config.mod.restic.enable;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
mod.restic = {
|
||||||
|
enable = lib.mkEnableOption "enable restic module";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf enabled {
|
||||||
|
services = {
|
||||||
|
restic.backups = {
|
||||||
|
"sync" = {
|
||||||
|
initialize = true;
|
||||||
|
|
||||||
|
user = "alex";
|
||||||
|
|
||||||
|
passwordFile = "/home/alex/backup/restic/password.file";
|
||||||
|
environmentFile = "/home/alex/backup/restic/aws.env";
|
||||||
|
repository = "s3:https://s3.eu-north-1.amazonaws.com/restic-sync-backup";
|
||||||
|
|
||||||
|
paths = ["/home/alex/backup/sync"];
|
||||||
|
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pruneOpts = [
|
||||||
|
"--keep-daily 2"
|
||||||
|
"--keep-weekly 7"
|
||||||
|
"--keep-yearly 12"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.restic ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user