Unverified Commit aebd63f5 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

pgbackrest: 2.55.1 -> 2.56.0 (#443717)

parents 124b966f 49f3a9f7
Loading
Loading
Loading
Loading
+55 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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;