aboutsummaryrefslogtreecommitdiff
path: root/nix/pkgs.nix
blob: cd158940e7f8ed642ec1589502d63ddb3256a422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  system ? builtins.currentSystem,
  nixpkgs ? builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/22.11.tar.gz";
    sha256 = "11w3wn2yjhaa5pv20gbfbirvjq6i3m7pqrq2msf0g7cv44vijwgw";
  }
}:
let
  # use the first version in the list for each component
  getMajorVersion = builtins.getEnv "PPQ_POSTGRES_VERSION";

  overlay = self: super: {
    # NOTE: Overlaying `postgresql` is not possible anymore, leads to
    # error: infinite recursion encountered
    #
    # TODO: Make extension packages more easily configurable.  For now
    # just load whatever we've ever needed.
    ppq_postgresql = super."postgresql_${getMajorVersion}".withPackages (p: [
      p.postgis
    ]);
  };

  pkgs =
  import nixpkgs {
    inherit system;
    overlays = [
      overlay
    ];
  };
in
pkgs