depot/third_party/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ ... }@ch:
2020-11-01 21:22:52 +00:00
let
nixpkgsConfig = {
allowUnfree = true;
permittedInsecurePackages = [
"p7zip-16.02"
];
};
2020-05-31 17:58:29 +00:00
nixpkgs = import ./nixpkgs {
config = nixpkgsConfig;
};
2020-11-01 21:22:52 +00:00
crate2nixSrc = nixpkgs.fetchFromGitHub {
owner = "kolloch";
repo = "crate2nix";
rev = "e07af104b8e41d1cd7e41dc7ac3fdcdf4953efae";
hash = "sha256:07syygn1rc5n1big7hf42pzgm5wc1r0mzglzvlbcb7rkzgqqhbqx";
};
in
rec {
inherit nixpkgsConfig nixpkgs;
nixos = import ./nixpkgs/nixos;
nixeval = import ./nixpkgs/nixos/lib/eval-config.nix;
buildGo =
let orig = import ./tvl/nix/buildGo { pkgs = nixpkgs; };
in orig // {
2020-10-18 00:02:46 +00:00
program = { dockerData ? [], ... }@args:
let
2020-10-18 00:02:46 +00:00
origOut = orig.program (nixpkgs.lib.filterAttrs (n: v: n != "dockerData") args);
in origOut // {
dockerImage = nixpkgs.dockerTools.buildImage {
name = args.name;
2020-10-18 00:02:46 +00:00
contents = dockerData;
config = {
2020-10-18 00:02:46 +00:00
Entrypoint = [ "${origOut}/bin/${args.name}" ];
Env = [
"SSL_CERT_FILE=${nixpkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
};
};
};
};
readTree = import ./tvl/nix/readTree {};
gopkgs = readTree ch ./gopkgs;
2020-11-01 21:22:52 +00:00
2020-11-01 21:39:25 +00:00
crate2nix = import "${crate2nixSrc}" { pkgs = ch.depot.pkgs; };
}