mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 23:11:34 +01:00
Enable healthchecks of restic-backups by default
This commit is contained in:
parent
41cd9f56f1
commit
cdeabbcc84
6 changed files with 4 additions and 15 deletions
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue