postgresql: reorganize package and its extensions#54319
Conversation
|
thanks, @ofborg |
|
|
|
On this branch I tried both pkgs.postgresqlPackages.postgis and (postgis.override { postgresql = postgresql} ) and they failed. The first one told me postgis did not exist and the second one gave me the following error: pdfsdk_headers.h:53:10: fatal error: goo/gtypes.h: No such file or directory On thoughtpolice's PR the first version works, on 18.09, the second version works. |
|
@ingenieroariel that may be true. I did port only a little part here, and never touched |
|
this has to be rebased over @thoughtpolice changes and fixes for postgis. Didn't expect problems, so developed yet another extender function |
83f8de5 to
e1d1275
Compare
Extracts some useful parts of NixOS#38698, in particular, it's vision that postgresql plugins should be namespaced. Original approach had several problems: - not gonna happen in forseeable future - did lots of deprecations - was all-in-one solution, which is hard to sell to nixpkgs - even that we have postgresqlPackages now, we can't do arbitrary overrides to postgresql and plugins. Several required functions were not exported Here I've fixed all of those problems: - deprecates nothing (though plugins were moved now into `aliases.nix`) - this doesn't touch NixOS at all, and doesn't break anything - hashes for plugins and PGs are not changed (I hope) - no extra fixes to pg itself - default PG is not changed - plugins and PGs are extensible Last one is the most interesting thing, because it introduces novel way to manage `XXX withPackages` problem. It is novel, but has got lots of inspiration from existing approaches: - python, so we have now `postgresql.pkgs.*`, `postgresql_11.pkgs.*` which all contain plugins compiled with correct PG. - python, so we have now `postgresql.withPackages` as well - in contrast to python, there are no `postgresql11Packages`, only `postgresql_11.pkgs` - NixOS#44196, so plugins are referenced starting at self-fixpoint. This allows override/add plugins with mere `//` in overlay. This works for both `postgresqlPackages` (overrides are applied to all postgresql_xx.pkgs) and `postgresql_xx.pkgs` (overrides are specific to this postgresql) sets - I've made it compatible with proposed mergeable overlays (NixOS#54266) however this PR doesn't depend on it - last, but not least, `postgresql/default.nix` is now an overlay! This replaces previous `callPackages` approach with a modern, extensible concept.
Previous approach turned out to be awful. It was impossible to perform deep override. This time I didn't invent bycicles and used overlays for subpackages. Big change is that now overriding `postgresqlPackages` doesn't override all other package sets. But `postgresqlPackages` are now also available as an overlay! So you can get that, reorganize whatever you want and then attach to some postgresql.
e1d1275 to
9e8f256
Compare
|
This pull request has been mentioned on Nix community. There might be relevant details there: |
Motivation for this change
Extracts some useful parts of #38698,
in particular, it's vision that postgresql plugins should be namespaced.
Original approach had several problems:
to postgresql and plugins. Several required functions were not exported
Here I've fixed all of those problems:
aliases.nix)Last one is the most interesting thing, because it introduces novel way
to manage
XXX withPackagesproblem. It is novel, but has got lots ofinspiration from existing approaches:
postgresql.pkgs.*,postgresql_11.pkgs.*which all contain plugins compiled with correct PG.
postgresql.withPackagesas wellpostgresql11Packages, onlypostgresql_11.pkgsThis allows override/add plugins with mere
//in overlay. This works forboth
postgresqlPackages(overrides are applied to all postgresql_xx.pkgs)and
postgresql_xx.pkgs(overrides are specific to this postgresql) setshowever this PR doesn't depend on it
postgresql/default.nixis now an overlay! Thisreplaces previous
callPackagesapproach with a modern, extensible concept.Further improvements should go in subsequent PRs! I have a plan to merge @thoughtpolice 's PR part-by-part till 19.03. If nobody explicitly objects current implementation, I'll merge soon.
Things done
I've checked only that hashes didn't change for postgresql_9_6, 10, 11 and default plugins.
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)