REWRITE
This commit is contained in:
+17
-22
@@ -42,6 +42,18 @@ in
|
||||
options.homey.backup = {
|
||||
enable = lib.mkEnableOption "Restic backup jobs";
|
||||
|
||||
extraPaths = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [];
|
||||
description = "Paths to include in the restic backup. Each service module contributes its own entries.";
|
||||
};
|
||||
|
||||
extraExcludePaths = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [];
|
||||
description = "Paths to exclude from the restic backup. Each service module contributes its own entries.";
|
||||
};
|
||||
|
||||
repository = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "sftp:user@nas.local:/backups/homey";
|
||||
@@ -127,32 +139,15 @@ in
|
||||
# Runtime env file written by homey-backup-pre.service (which runs first)
|
||||
environmentFile = "/run/restic-homey-secrets.env";
|
||||
|
||||
paths = [
|
||||
"${dataDir}/openldap"
|
||||
"${dataDir}/authelia"
|
||||
"${dataDir}/gitea"
|
||||
"${dataDir}/nextcloud"
|
||||
# media and transmission config included when those services are enabled:
|
||||
"${dataDir}/jellyfin"
|
||||
"${dataDir}/transmission"
|
||||
# Deliberately excluded: media/* (large, can be re-downloaded)
|
||||
# Monitoring — uptime-kuma has monitors/history, ntfy has user accounts
|
||||
"${dataDir}/uptime-kuma"
|
||||
"${dataDir}/ntfy"
|
||||
# Eurovision Vote — SQLite DB with votes and rankings
|
||||
"/var/lib/eurovote"
|
||||
"${dataDir}/paperless"
|
||||
"${dataDir}/mealie"
|
||||
];
|
||||
# Paths are contributed by individual service modules via homey.backup.extraPaths.
|
||||
paths = config.homey.backup.extraPaths;
|
||||
|
||||
# Exclude Nextcloud's raw DB directory in favour of the pg_dump file
|
||||
exclude = [
|
||||
"${dataDir}/nextcloud/db"
|
||||
# restic's own local cache is never worth backing up
|
||||
"${dataDir}/restic-cache"
|
||||
# media is large and can be re-downloaded; services exclude their own consume dirs
|
||||
"${dataDir}/media"
|
||||
# consume dir holds unprocessed drop files; usually empty after ingestion
|
||||
"${dataDir}/paperless/consume"
|
||||
];
|
||||
] ++ config.homey.backup.extraExcludePaths;
|
||||
|
||||
timerConfig = {
|
||||
OnCalendar = cfg.schedule;
|
||||
|
||||
Reference in New Issue
Block a user