nixpkgs-suyu/nixos/modules
Maximilian Bosch 43dbeae02d
postgresql: pass through JIT-enabled variant of non-JIT postgres and vice versa
This is useful if your postgresql version is dependant on
`system.stateVersion` and not pinned down manually. Then it's not
necessary to find out which version exactly is in use and define
`package` manually, but just stay with what NixOS provides as default:

    $ nix-instantiate -A postgresql
    /nix/store/82fzmb77mz2b787dgj7mn4a8i4f6l6sn-postgresql-14.7.drv
    $ nix-instantiate -A postgresql_jit
    /nix/store/qsjkb72fcrrfpsszrwbsi9q9wgp39m50-postgresql-14.7.drv
    $ nix-instantiate -A postgresql.withJIT
    /nix/store/qsjkb72fcrrfpsszrwbsi9q9wgp39m50-postgresql-14.7.drv
    $ nix-instantiate -A postgresql.withJIT.withoutJIT
    /nix/store/82fzmb77mz2b787dgj7mn4a8i4f6l6sn-postgresql-14.7.drv

I.e. you can use postgresql with JIT (for complex queries only[1]) like
this:

    services.postgresql = {
      enable = true;
      enableJIT = true;
    };

Performing a new override instead of re-using the `_jit`-variants for
that has the nice property that overlays for the original package apply
to the JIT-enabled variant, i.e.

    with import ./. {
      overlays = [
        (self: super: {
          postgresql = super.postgresql.overrideAttrs (_: { fnord = "snens"; });
        })
      ];
    };
    postgresql.withJIT.fnord

still gives the string `snens` whereas `postgresql_jit` doesn't have the
attribute `fnord` in its derivation.

[1] https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-JIT-ABOVE-COST
2023-03-29 08:39:46 +02:00
..
config Merge pull request #222205 from NickCao/zram-writeback-device 2023-03-23 13:14:08 +08:00
hardware nixos/hidpi: remove 2023-03-21 13:29:57 +01:00
i18n/input-method nixos/manual: render module chapters with nixos-render-docs 2023-01-27 20:07:34 +01:00
installer Merge pull request #221576 from paumr/nixos-generate-config_fix_syntax 2023-03-22 20:10:43 +01:00
misc solr: drop 2023-03-16 16:17:04 +02:00
profiles nixos/profiles/base: remove duplicate and optimize fsPackages 2023-03-03 23:32:48 +03:00
programs wxGTK30, wxmac: drop 2023-03-22 13:56:44 +02:00
security doas: refactor config generation 2023-03-17 09:05:08 -07:00
services postgresql: pass through JIT-enabled variant of non-JIT postgres and vice versa 2023-03-29 08:39:46 +02:00
system Merge pull request #218721 from apfelkuchen6/nw 2023-03-22 22:22:03 +01:00
tasks Merge remote-tracking branch 'origin/master' into staging-next 2023-03-14 16:49:37 +01:00
testing
virtualisation Merge #219444: staging-next 2023-03-04 2023-03-15 17:35:39 +01:00
module-list.nix keyd: add keyd service and test 2023-03-22 15:12:29 +01:00
rename.nix baget: remove due to upstream being unmaintained 2023-03-19 14:19:49 +01:00