I’m still quite new to NixOS but enjoying it. Packaging my first go applications has worked fine so far but with sqlc I’m a bit stuck. I found out some build dependencies (e.g. libpq_query
and xxHash
) and added them. This resolved previous errors but now I’m stuck with the following error:
# github.com/pganalyze/pg_query_go/v2/parser
In file included from pg_query.c:2:
pg_query_internal.h:4:10: fatal error: postgres.h: No such file or directory
4 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
I thought adding postgresql to the buildInputs
should fix this but it does not. What am I missing?
{ lib, buildGoModule, fetchgit, makeWrapper, postgresql, libpg_query, xxHash}:
buildGoModule rec {
pname = "";
version = "v1.12.0";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [libpg_query xxHash postgresql];
src = fetchgit {
url = "https://github.com/kyleconroy/sqlc";
rev = "refs/tags/${version}";
sha256 = "sha256-YlOkjqkhN+4hL1+KJ0TuqcbQXJad/bHZclgpgFPr4to=";
};
vendorSha256 = "sha256-U2tORgGiFcODCijfq/ZQ1kWk2UpCz0oBn4oVGFOs8Lk=";
doCheck = false;
subPackages = [ "cmd/sqlc" ];
meta = with lib; {
description = "sqlc generates type-safe code from SQL.";
homepage = "https://sqlc.dev/";
license = licenses.mit;
platforms = platforms.unix;
};
}