mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
restic: Add dedicated paths option
This commit is contained in:
parent
2761fc8953
commit
7e25a91691
7 changed files with 19 additions and 17 deletions
|
|
@ -32,7 +32,7 @@ in
|
|||
|
||||
custom.services.resticBackups.actual = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "actual.service";
|
||||
extraConfig.paths = [ config.services.actual.settings.dataDir ];
|
||||
paths = [ config.services.actual.settings.dataDir ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ in
|
|||
|
||||
custom.services.resticBackups.filebrowser = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "filebrowser.service";
|
||||
extraConfig.paths = with config.services.filebrowser.settings; [
|
||||
paths = with config.services.filebrowser.settings; [
|
||||
database
|
||||
root
|
||||
];
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ in
|
|||
|
||||
custom.services.resticBackups.forgejo = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "forgejo.service";
|
||||
extraConfig.paths = [ config.services.forgejo.stateDir ];
|
||||
paths = [ config.services.forgejo.stateDir ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,14 +68,10 @@ in
|
|||
|
||||
custom.services.resticBackups.hedgedoc = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "hedgedoc.service";
|
||||
extraConfig.paths =
|
||||
let
|
||||
hedgedocSettings = config.services.hedgedoc.settings;
|
||||
in
|
||||
[
|
||||
hedgedocSettings.uploadsPath
|
||||
hedgedocSettings.db.storage
|
||||
];
|
||||
paths = with config.services.hedgedoc.settings; [
|
||||
uploadsPath
|
||||
db.storage
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,17 +17,18 @@ in
|
|||
|
||||
config = lib.mkIf cfg.doBackups {
|
||||
custom.services.resticBackups.nextcloud = {
|
||||
paths = [
|
||||
"${dataDir}/data"
|
||||
"${dataDir}/config/config.php"
|
||||
"${dataDir}/db.dump"
|
||||
];
|
||||
|
||||
extraConfig = {
|
||||
backupPrepareCommand = ''
|
||||
${nextcloud-occ} maintenance:mode --on
|
||||
${lib.getExe pkgs.sudo} --user=${user} ${lib.getExe' config.services.postgresql.package "pg_dump"} nextcloud --format=custom --file=${dataDir}/db.dump
|
||||
'';
|
||||
backupCleanupCommand = "${nextcloud-occ} maintenance:mode --off";
|
||||
paths = [
|
||||
"${dataDir}/data"
|
||||
"${dataDir}/config/config.php"
|
||||
"${dataDir}/db.dump"
|
||||
];
|
||||
};
|
||||
|
||||
restoreCommand = {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ in
|
|||
type = lib.types.nullOr lib.types.nonEmptyStr;
|
||||
default = null;
|
||||
};
|
||||
paths = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.path;
|
||||
default = [ ];
|
||||
};
|
||||
extraConfig = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
|
|
@ -47,6 +51,7 @@ in
|
|||
name: value:
|
||||
lib.mkMerge [
|
||||
{
|
||||
inherit (value) paths;
|
||||
initialize = true;
|
||||
repository = "s3:https://s3.eu-central-003.backblazeb2.com/stork-atlas/${name}";
|
||||
environmentFile = config.sops.templates."restic/environment".path;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ in
|
|||
|
||||
custom.services.resticBackups.syncthing = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "syncthing.service";
|
||||
extraConfig.paths = [ config.services.syncthing.dataDir ];
|
||||
paths = [ config.services.syncthing.dataDir ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue