diff --git a/flake.lock b/flake.lock index 9d2865e1d..a97e110c7 100644 --- a/flake.lock +++ b/flake.lock @@ -239,6 +239,22 @@ "type": "github" } }, + "nixpkgs-pgbackrest": { + "locked": { + "lastModified": 1761373498, + "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1749411262, @@ -312,6 +328,7 @@ "nix2container": "nix2container", "nixpkgs": "nixpkgs_4", "nixpkgs-go124": "nixpkgs-go124", + "nixpkgs-pgbackrest": "nixpkgs-pgbackrest", "rust-overlay": "rust-overlay", "treefmt-nix": "treefmt-nix_2" } diff --git a/flake.nix b/flake.nix index db14dac9a..e8d8f08e4 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ git-hooks.url = "github:cachix/git-hooks.nix"; git-hooks.inputs.nixpkgs.follows = "nixpkgs"; nixpkgs-go124.url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0"; + nixpkgs-pgbackrest.url = "github:nixos/nixpkgs/nixos-unstable-small"; }; outputs = diff --git a/nix/packages/default.nix b/nix/packages/default.nix index f297c8359..b73002ac1 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -40,6 +40,7 @@ migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; }; overlayfs-on-package = pkgs.callPackage ./overlayfs-on-package.nix { }; packer = pkgs.callPackage ./packer.nix { inherit inputs; }; + pg-backrest = inputs.nixpkgs-pgbackrest.legacyPackages.${pkgs.system}.pgbackrest; pg-restore = pkgs.callPackage ./pg-restore.nix { psql_15 = self'.packages."psql_15/bin"; }; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = makePgRegress activeVersion; diff --git a/nix/packages/pgbackrest.nix b/nix/packages/pgbackrest.nix deleted file mode 100644 index 2ca8277a2..000000000 --- a/nix/packages/pgbackrest.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - bzip2, - fetchFromGitHub, - lib, - libbacktrace, - libpq, - libssh2, - libxml2, - libyaml, - lz4, - meson, - ninja, - pkg-config, - python3, - stdenv, - zlib, - zstd, - nixosTests, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "pgbackrest"; - version = "2.57.0"; - - src = fetchFromGitHub { - owner = "pgbackrest"; - repo = "pgbackrest"; - tag = "release/${finalAttrs.version}"; - hash = "sha256-d794519c0ecb4ec17f41c4267d07fe80ab6b3ac9cc1de5c7984887c5e6d7448a"; - }; - - strictDeps = true; - - nativeBuildInputs = [ - meson - ninja - pkg-config - python3 - ]; - - buildInputs = [ - bzip2 - libbacktrace - libpq - libssh2 - libxml2 - libyaml - lz4 - zlib - zstd - ]; - - passthru.tests = nixosTests.pgbackrest; - - meta = { - description = "Reliable PostgreSQL backup & restore"; - homepage = "https://pgbackrest.org"; - changelog = "https://github.com/pgbackrest/pgbackrest/releases/tag/release%2F${finalAttrs.version}"; - license = lib.licenses.mit; - mainProgram = "pgbackrest"; - }; -})