diff --git a/third_party/default.nix b/third_party/default.nix index 4dbe5e6a88..4056b5fe52 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -2,18 +2,33 @@ # # SPDX-License-Identifier: Apache-2.0 -{ ... }: +{ ... }@ch: let nixpkgsConfig = { allowUnfree = true; permittedInsecurePackages = [ "p7zip-16.02" ]; }; in -{ +rec { inherit nixpkgsConfig; nixpkgs = import ./nixpkgs { config = nixpkgsConfig; }; nixos = import ./nixpkgs/nixos; nixeval = import ./nixpkgs/nixos/lib/eval-config.nix; + buildGo = + let orig = import ./tvl/nix/buildGo { pkgs = nixpkgs; }; + in orig // { + program = args: + let + origOut = orig.program args; + in origOut // { + dockerImage = nixpkgs.dockerTools.buildImage { + name = args.name; + config = { Cmd = [ "${origOut}/bin/${args.name}" ]; }; + }; + }; + }; + readTree = import ./tvl/nix/readTree {}; + gopkgs = readTree ch ./gopkgs; } diff --git a/third_party/gopkgs/github.com/dghubble/oauth1/default.nix b/third_party/gopkgs/github.com/dghubble/oauth1/default.nix new file mode 100644 index 0000000000..4e9219666d --- /dev/null +++ b/third_party/gopkgs/github.com/dghubble/oauth1/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/dghubble/oauth1"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "dghubble"; + repo = "oauth1"; + rev = "6a43e27d73f59c407eb2a1c7ce315527e8bb25fe"; + sha256 = "1nx2znp37yhd10w99wnvd5xs0ps6w3qa1xa6brx2a9rpwnmqhyif"; + }; +} diff --git a/third_party/gopkgs/github.com/jackc/chunkreader/v2/default.nix b/third_party/gopkgs/github.com/jackc/chunkreader/v2/default.nix new file mode 100644 index 0000000000..2ac0fc1df7 --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/chunkreader/v2/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/chunkreader/v2"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "chunkreader"; + rev = "3c4a99247c6656284dd2be8d74438ca9bbb4f342"; + sha256 = "0fj585hp3s4cjfzncr5gmim96p0b956pqdf4nm7yan1ipfch9l1c"; + }; +} diff --git a/third_party/gopkgs/github.com/jackc/default.nix b/third_party/gopkgs/github.com/jackc/default.nix new file mode 100644 index 0000000000..27bd54fd2f --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/default.nix @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +args: { + pgconn = import ./pgconn args; + pgx = import ./pgx args; +} diff --git a/third_party/gopkgs/github.com/jackc/pgconn/default.nix b/third_party/gopkgs/github.com/jackc/pgconn/default.nix new file mode 100644 index 0000000000..6d91768b27 --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgconn/default.nix @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgconn"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgconn"; + rev = "035868ca0c24b120f199e4bef6ac29a333e76baa"; + sha256 = "030h8c2jjdh03fgff9zg842d0vmncfn1rv3g8drp73fmw0l3yp66"; + }; + deps = [ + depot.third_party.gopkgs."github.com".jackc.chunkreader.v2 + depot.third_party.gopkgs."github.com".jackc.pgio + depot.third_party.gopkgs."github.com".jackc.pgpassfile + depot.third_party.gopkgs."github.com".jackc.pgproto3.v2 + depot.third_party.gopkgs."github.com".jackc.pgservicefile + depot.third_party.gopkgs."golang.org".x.crypto.pbkdf2 + depot.third_party.gopkgs."golang.org".x.text.secure.precis + depot.third_party.gopkgs."golang.org".x.xerrors + ]; +} diff --git a/third_party/gopkgs/github.com/jackc/pgio/default.nix b/third_party/gopkgs/github.com/jackc/pgio/default.nix new file mode 100644 index 0000000000..5fade4794d --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgio/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgio"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgio"; + rev = "8d9c2a3dafd92d070bd758a165022fd1059e3195"; + sha256 = "0l17gpn11wf6jm5kbfmxh8j00n5zpmwck3wr91f1cv34k4chyvg1"; + }; +} diff --git a/third_party/gopkgs/github.com/jackc/pgpassfile/default.nix b/third_party/gopkgs/github.com/jackc/pgpassfile/default.nix new file mode 100644 index 0000000000..ae2920b5df --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgpassfile/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgpassfile"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgpassfile"; + rev = "99d8e8e28945ffceaf75b0299fcb2bb656b8a683"; + sha256 = "1crw06lzksgimbmr1a3sr00azg2v7l4qkvjra1cpmzzq5mncaj8z"; + }; +} diff --git a/third_party/gopkgs/github.com/jackc/pgproto3/v2/default.nix b/third_party/gopkgs/github.com/jackc/pgproto3/v2/default.nix new file mode 100644 index 0000000000..aefdfddc9b --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgproto3/v2/default.nix @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgproto3/v2"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgproto3"; + rev = "835cf1b0689d054f58d82f3970d59abae56178dc"; + sha256 = "05jk4arv72rhd0qaf8jn4fm6ivb6l7haqbk7c8xjvxmli9sv83yg"; + }; + deps = [ + depot.third_party.gopkgs."github.com".jackc.chunkreader.v2 + depot.third_party.gopkgs."github.com".jackc.pgio + ]; +} diff --git a/third_party/gopkgs/github.com/jackc/pgservicefile/default.nix b/third_party/gopkgs/github.com/jackc/pgservicefile/default.nix new file mode 100644 index 0000000000..2329ed22ad --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgservicefile/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgservicefile"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgservicefile"; + rev = "2b9c44734f2b95eb1f5814e0ab09b61f9dde09e6"; + sha256 = "13gbi0ad58rm3rcgj8bssc7hgrqwva0q015fw57vx5cxb4rcrmxh"; + }; +} diff --git a/third_party/gopkgs/github.com/jackc/pgtype/default.nix b/third_party/gopkgs/github.com/jackc/pgtype/default.nix new file mode 100644 index 0000000000..059f24c5da --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgtype/default.nix @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgtype"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgtype"; + rev = "376361f53ddd86ad4381ee4e5d5a802fa33c3de7"; + sha256 = "0wfyn0fwa0h0vkmbj3kxrr3jndvr1hxxgzpx8hl0n8wnzvsnfvbm"; + }; + deps = [ + depot.third_party.gopkgs."github.com".jackc.pgio + depot.third_party.gopkgs."golang.org".x.xerrors + ]; +} diff --git a/third_party/gopkgs/github.com/jackc/pgx/v4/default.nix b/third_party/gopkgs/github.com/jackc/pgx/v4/default.nix new file mode 100644 index 0000000000..95983cdd2e --- /dev/null +++ b/third_party/gopkgs/github.com/jackc/pgx/v4/default.nix @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "github.com/jackc/pgx/v4"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "jackc"; + repo = "pgx"; + rev = "2a8ae6f269e17c44d25cd0f713eaa6356547206e"; + sha256 = "13bfd0wm2h821z5nlgz8i4mgwzj57ggdjd2qli9ys8g53jb84avw"; + }; + deps = [ + depot.third_party.gopkgs."github.com".jackc.pgconn + depot.third_party.gopkgs."github.com".jackc.pgconn.stmtcache + depot.third_party.gopkgs."github.com".jackc.pgio + depot.third_party.gopkgs."github.com".jackc.pgproto3.v2 + depot.third_party.gopkgs."github.com".jackc.pgtype + depot.third_party.gopkgs."golang.org".x.xerrors + ]; +} diff --git a/third_party/gopkgs/golang.org/x/crypto/default.nix b/third_party/gopkgs/golang.org/x/crypto/default.nix new file mode 100644 index 0000000000..8749f52f66 --- /dev/null +++ b/third_party/gopkgs/golang.org/x/crypto/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "golang.org/x/crypto"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "golang"; + repo = "crypto"; + rev = "7f63de1d35b0f77fa2b9faea3e7deb402a2383c8"; + sha256 = "1dr89jfs4dmpr3jqfshqqvfpzzdx4r76nkzhrvmixfrmn6wxrnd1"; + }; +} diff --git a/third_party/gopkgs/golang.org/x/text/default.nix b/third_party/gopkgs/golang.org/x/text/default.nix new file mode 100644 index 0000000000..4f418b3764 --- /dev/null +++ b/third_party/gopkgs/golang.org/x/text/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "golang.org/x/text"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "golang"; + repo = "text"; + rev = "a8b4671254579a87fadf9f7fa577dc7368e9d009"; + sha256 = "1yhvfh3zi4xc2wlik21pwpfwrjq381zb3v3n6l12625fiiczrqqn"; + }; +} diff --git a/third_party/gopkgs/golang.org/x/xerrors/default.nix b/third_party/gopkgs/golang.org/x/xerrors/default.nix new file mode 100644 index 0000000000..802cb02cd6 --- /dev/null +++ b/third_party/gopkgs/golang.org/x/xerrors/default.nix @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ depot, ... }: +depot.third_party.buildGo.external { + path = "golang.org/x/xerrors"; + src = depot.third_party.nixpkgs.fetchFromGitHub { + owner = "golang"; + repo = "xerrors"; + rev = "5ec99f83aff198f5fbd629d6c8d8eb38a04218ca"; + sha256 = "1dbzc3gmf2haazpv7cgmv97rq40g2xzwbglc17vas8dwhgwgwrzb"; + }; +}