pgschema
pgschema copied to clipboard
Add pgschema to nix package
As the title says, it would be super helpful to have it as a nix package. For our case it would be used twofold:
- Being used in the local env during development without having to install for each new mashine
- We are building our container with nix and created a little K8s operator around pgschema, which is the only tool that needs the Docker image.
I have little experience with nix. Contribution welcome
Not familiar with Go, but the Dockerfile looks simple enough. I will look into it.
One can use:
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "pgschema";
version = "1.7.4";
src = fetchFromGitHub {
owner = "pgplex";
repo = "pgschema";
rev = "v${version}";
hash = "sha256-c1Z8mubchdP+dMROf2fa+H+mN/y3MuGhSY7Cs0MEAzw=";
};
vendorHash = "sha256-NXTGbts0Mb/h/ymL76kpFUMBZ+kNt06+KdtVsDFeGYw=";
ldflags = [
"-s"
"-w"
];
doCheck = false;
meta = with lib; {
description = "Terraform-style declarative schema migration CLI for Postgres";
homepage = "https://www.pgschema.com";
changelog = "https://github.com/pgplex/pgschema/releases/tag/v${version}";
license = licenses.asl20;
mainProgram = "pgschema";
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ ];
};
}
And then use it in a nix flake via import pgschema = pkgs.callPackage <your path>/pgschema/default.nix { };