pgbackrest: 2.55.1 -> 2.56.0 (#443717)

This commit is contained in:
Wolfgang Walther
2025-09-18 08:34:09 +00:00
committed by GitHub
2 changed files with 57 additions and 3 deletions
+55 -1
View File
@@ -55,6 +55,9 @@ let
fullConfig = {
global = normalize (cfg.settings // flattenWithIndex cfg.repos "repo");
}
// lib.mapAttrs' (
cmd: settings: lib.nameValuePair "global:${cmd}" (normalize settings)
) cfg.commands
// lib.mapAttrs (
_: cfg': normalize (cfg'.settings // flattenWithIndex cfg'.instances "pg")
) cfg.stanzas;
@@ -95,7 +98,6 @@ in
};
# TODO: Add enableServer option and corresponding pgBackRest TLS server service.
# TODO: Allow command-specific options
# TODO: Write wrapper around pgbackrest to turn --repo=<name> into --repo=<number>
# The following two are dependent on improvements upstream:
# https://github.com/pgbackrest/pgbackrest/issues/2621
@@ -328,6 +330,55 @@ in
}
'';
};
commands =
lib.genAttrs
[
# List of commands from https://pgbackrest.org/command.html:
"annotate"
"archive-get"
"archive-push"
"backup"
"check"
"expire"
"help"
"info"
"repo-get"
"repo-ls"
"restore"
"server"
"server-ping"
"stanza-create"
"stanza-delete"
"stanza-upgrade"
"start"
"stop"
"verify"
"version"
]
(
command:
lib.mkOption {
type = lib.types.submodule {
freeformType = settingsType;
# The following options are not fully supported / tested, yet, but point to files with secrets.
# Users can already set those options, but we'll force non-store paths.
options.tls-server-cert-file = secretPathOption;
options.tls-server-key-file = secretPathOption;
};
default = { };
description = ''
Options for the '${command}' command.
An attribute set of options as described in:
<https://pgbackrest.org/configuration.html>
All globally available options, i.e. all except stanza options, can be used.
Repository options should be set via [`repos`](#opt-services.pgbackrest.repos) instead.
'';
}
);
};
config = lib.mkIf cfg.enable (
@@ -408,6 +459,9 @@ in
user = "postgres";
};
};
# If PostgreSQL runs on the same machine, any restore will have to be done with that user.
# Keeping the lock file in a directory writeable by the postgres user prevents errors.
services.pgbackrest.commands.restore.lock-path = "/tmp/postgresql";
services.postgresql.identMap = ''
postgres pgbackrest postgres
'';
+2 -2
View File
@@ -20,13 +20,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "pgbackrest";
version = "2.55.1";
version = "2.56.0";
src = fetchFromGitHub {
owner = "pgbackrest";
repo = "pgbackrest";
tag = "release/${finalAttrs.version}";
hash = "sha256-A1dTywcCHBu7Ml0Q9k//VVPFN1C3kmmMkq4ok9T4g94=";
hash = "sha256-GDHpeTz85cgKTbcuaTlwJ1SUNMedSylqKWdrgH8Zp8Q=";
};
strictDeps = true;