# SPDX-FileCopyrightText: 2020 Luke Granger-Brown # # SPDX-License-Identifier: Apache-2.0 { depot, system, ... }@ch: let nixpkgsConfig = { allowUnfree = true; checkMeta = false; permittedInsecurePackages = [ "p7zip-16.02" ]; packageOverrides = pkgs: { factorio = pkgs.factorio.override depot.ops.secrets.factorio; factorio-experimental = pkgs.factorio-experimental.override depot.ops.secrets.factorio; delve = pkgs.delve.overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { platforms = oldAttrs.meta.platforms ++ [ "aarch64-linux" ]; }; }); }; }; nixpkgs = import ./nixpkgs { inherit system; config = nixpkgsConfig; }; crate2nixSrc = nixpkgs.fetchFromGitHub { owner = "kolloch"; repo = "crate2nix"; rev = "e07af104b8e41d1cd7e41dc7ac3fdcdf4953efae"; hash = "sha256:07syygn1rc5n1big7hf42pzgm5wc1r0mzglzvlbcb7rkzgqqhbqx"; }; naerskSrc = nixpkgs.fetchFromGitHub { owner = "nmattia"; repo = "naersk"; rev = "e0fe990b478a66178a58c69cf53daec0478ca6f9"; sha256 = "sha256:0qjyfmw5v7s6ynjns4a61vlyj9cghj7vbpgrp9147ngb1f8krz2c"; }; nixpkgsOldSrc = nixpkgs.fetchFromGitHub { owner = "nixos"; repo = "nixpkgs"; rev = "ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90"; sha256 = "0dq22dagzk76x2ws4dz88w018i6byamd6rnzqizx68bzimg6g7xn"; }; nixpkgsOld = import "${nixpkgsOldSrc}" { inherit system; config = nixpkgsConfig; }; tvlDepot = import ./tvl { nixpkgsBisectPath = ./nixpkgs; inherit nixpkgsConfig; }; in rec { inherit nixpkgsConfig nixpkgs nixpkgsOld; nixos = import ./nixpkgs/nixos; nixeval = import ./nixpkgs/nixos/lib/eval-config.nix; buildGo = let orig = import ./tvl/nix/buildGo { pkgs = nixpkgs; inherit gopkgs; }; in orig // { program = { dockerData ? [], ... }@args: let origOut = orig.program (nixpkgs.lib.filterAttrs (n: v: n != "dockerData") args); in origOut // { dockerImage = nixpkgs.dockerTools.buildImage { name = args.name; copyToRoot = nixpkgs.buildEnv { name = "${args.name}-env"; paths = dockerData; }; config = { Entrypoint = [ "${origOut}/bin/${args.name}" ]; Env = [ "SSL_CERT_FILE=${nixpkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; }; }; }; }; readTree = import ./tvl/nix/readTree {}; gopkgs = readTree { args = ch; path = ./gopkgs; }; bat_syntaxes = tvlDepot.third_party.bat_syntaxes; cheddar = tvlDepot.tools.cheddar; naersk = nixpkgs.callPackage naerskSrc {}; crate2nix = import "${crate2nixSrc}" { pkgs = ch.depot.pkgs; }; }