From c45f64a8348ede38b60a394786814280376009f5 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 14 Aug 2023 09:21:25 -0500 Subject: [PATCH] fix --- flake.nix | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index ac24f8a..206ecdf 100644 --- a/flake.nix +++ b/flake.nix @@ -244,14 +244,15 @@ type = lib.types.str; }; }; + # default = { }; }; + # default = { }; }; }; - default = { }; + # default = { }; }; - - default = { }; + # default = { }; }; users = lib.options.mkOption { @@ -482,6 +483,7 @@ # } # '' # ); + curl = "${pkgs.curl}/bin/curl --silent --show-error --max-time 10 --retry 5"; in lib.mkIf cfg.enable { assertions = [ @@ -623,7 +625,7 @@ ] else ""; - curl = "${pkgs.curl}/bin/curl --silent --show-error --max-time 10 --retry 5"; + in { description = "PostgreSQL Server"; @@ -823,13 +825,13 @@ systemd.services.postgresql-backup-full = lib.mkIf (cfg.backup.enable && (!cfg.replication.enable || cfg.replication.role == "primary")) ( let hcStart = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.fullBackupPingURL}/start" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.fullBackupPingURL}/start" else ""; hcStop = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.fullBackupPingURL}" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.fullBackupPingURL}" else ""; in @@ -853,7 +855,7 @@ Type = "oneshot"; User = "postgres"; Group = "postgres"; - TimeoutSec = 3600; + TimeoutSec = "4h"; }; } ); @@ -870,13 +872,13 @@ systemd.services.postgresql-backup-diff = lib.mkIf (cfg.backup.enable && (!cfg.replication.enable || cfg.replication.role == "primary")) ( let hcStart = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.differentialBackupPingURL}/start" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.differentialBackupPingURL}/start" else ""; hcStop = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.differentialBackupPingURL}" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.differentialBackupPingURL}" else ""; in @@ -917,13 +919,13 @@ systemd.services.postgresql-backup-incr = lib.mkIf (cfg.backup.enable && (!cfg.replication.enable || cfg.replication.role == "primary")) ( let hcStart = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.incrementalBackupPingURL}/start" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.incrementalBackupPingURL}/start" else ""; hcStop = - if cfg.backup.healthchecks.enable then - "${curl} ${cfg.backup.healthchecks.incrementalBackupPingURL}" + if cfg.backup.healthcheck.enable then + "${curl} ${cfg.backup.healthcheck.incrementalBackupPingURL}" else ""; in @@ -940,7 +942,7 @@ ${pgbackrest}/bin/pgbackrest --type=incr --start-fast --stop-auto --delta backup - ${hsStop} + ${hcStop} ''; environment = pgbackrestEnvironment; serviceConfig = {