Enable healthchecks of restic-backups by default

This commit is contained in:
SebastianStork 2025-06-07 00:34:38 +02:00
parent 41cd9f56f1
commit cdeabbcc84
6 changed files with 4 additions and 15 deletions

View file

@ -30,8 +30,6 @@ in
custom.services.resticBackups.actual = { custom.services.resticBackups.actual = {
inherit user; inherit user;
healthchecks.enable = true;
extraConfig = { extraConfig = {
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop actual.service"; backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop actual.service";
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start actual.service"; backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start actual.service";

View file

@ -30,8 +30,6 @@ in
custom.services.resticBackups.forgejo = { custom.services.resticBackups.forgejo = {
inherit user; inherit user;
healthchecks.enable = true;
extraConfig = { extraConfig = {
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop forgejo.service"; backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop forgejo.service";
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start forgejo.service"; backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start forgejo.service";

View file

@ -30,8 +30,6 @@ in
custom.services.resticBackups.hedgedoc = { custom.services.resticBackups.hedgedoc = {
inherit user; inherit user;
healthchecks.enable = true;
extraConfig = { extraConfig = {
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop hedgedoc.service"; backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop hedgedoc.service";
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start hedgedoc.service"; backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start hedgedoc.service";

View file

@ -16,8 +16,6 @@ in
config = lib.mkIf cfg.backups.enable { config = lib.mkIf cfg.backups.enable {
custom.services.resticBackups.nextcloud = { custom.services.resticBackups.nextcloud = {
inherit user; inherit user;
healthchecks.enable = true;
extraConfig = { extraConfig = {
backupPrepareCommand = '' backupPrepareCommand = ''
${lib.getExe' config.services.nextcloud.occ "nextcloud-occ"} maintenance:mode --on ${lib.getExe' config.services.nextcloud.occ "nextcloud-occ"} maintenance:mode --on

View file

@ -16,16 +16,15 @@ in
options.custom.services.resticBackups = lib.mkOption { options.custom.services.resticBackups = lib.mkOption {
type = lib.types.attrsOf ( type = lib.types.attrsOf (
lib.types.submodule { lib.types.submodule {
options.healthchecks.enable = lib.mkEnableOption ""; options.healthchecks.enable = lib.mkEnableOption "" // {
default = true;
};
} }
); );
}; };
config = lib.mkIf (resticBackups != { }) { config = lib.mkIf (resticBackups != { }) {
sops.secrets."healthchecks-ping-key" = { sops.secrets."healthchecks-ping-key" = { };
mode = "440";
group = config.users.groups.backup.name;
};
systemd.services = lib.mkMerge [ systemd.services = lib.mkMerge [
{ {

View file

@ -39,8 +39,6 @@ in
custom.services.resticBackups.syncthing = { custom.services.resticBackups.syncthing = {
inherit user; inherit user;
healthchecks.enable = true;
extraConfig = { extraConfig = {
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop syncthing.service"; backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop syncthing.service";
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start syncthing.service"; backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start syncthing.service";