depot/third_party/default.nix

109 lines
3.5 KiB
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
2021-09-05 09:21:41 +00:00
{ depot, system, ... }@ch:
2020-11-01 21:22:52 +00:00
let
nixpkgsConfig = {
allowUnfree = true;
checkMeta = false;
2020-11-01 21:22:52 +00:00
permittedInsecurePackages = [
"p7zip-16.02"
];
packageOverrides = pkgs: {
factorio = pkgs.factorio.override depot.ops.secrets.factorio;
factorio-experimental = pkgs.factorio-experimental.override depot.ops.secrets.factorio;
ntfy = (pkgs.ntfy.override {
withXmpp = false;
withSlack = false;
python39 = pkgs.python3;
}).overridePythonAttrs (oldAttrs: {
doCheck = false;
checkPhase = "";
});
delve = pkgs.delve.overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // {
platforms = oldAttrs.meta.platforms ++ [ "aarch64-linux" ];
};
});
};
2020-11-01 21:22:52 +00:00
};
2020-05-31 17:58:29 +00:00
nixpkgs = import ./nixpkgs {
2021-09-05 09:21:41 +00:00
inherit system;
2020-05-31 17:58:29 +00:00
config = nixpkgsConfig;
2023-08-09 01:51:03 +00:00
overlays = [(final: prev: {
go_1_20_socket = prev.go_1_20.overrideAttrs (old: {
patches = old.patches ++ [(final.fetchpatch {
url = "https://go.googlesource.com/go/+/ad087ee2804b7ce088161df04403c93ddc623888%5E%21?format=TEXT";
sha256 = "14z1rgn2qhmzhk9b8iksdknzrf0fbbhabqngcz5jlskc8vwdd14v";
decode = "base64 -d";
})];
});
vault = prev.vault.override {
buildGoModule = prev.buildGoModule.override {
go = final.go_1_20_socket;
};
};
go_1_19_socket = prev.go_1_19.overrideAttrs (old: {
patches = old.patches ++ [(final.fetchpatch {
url = "https://go.googlesource.com/go/+/ad087ee2804b7ce088161df04403c93ddc623888%5E%21?format=TEXT";
sha256 = "14z1rgn2qhmzhk9b8iksdknzrf0fbbhabqngcz5jlskc8vwdd14v";
decode = "base64 -d";
})];
});
})];
2020-05-31 17:58:29 +00:00
};
2020-11-01 21:22:52 +00:00
crate2nixSrc = nixpkgs.fetchFromGitHub {
owner = "kolloch";
repo = "crate2nix";
rev = "e07af104b8e41d1cd7e41dc7ac3fdcdf4953efae";
hash = "sha256:07syygn1rc5n1big7hf42pzgm5wc1r0mzglzvlbcb7rkzgqqhbqx";
};
2021-03-21 18:52:09 +00:00
naerskSrc = nixpkgs.fetchFromGitHub {
owner = "nmattia";
repo = "naersk";
rev = "e0fe990b478a66178a58c69cf53daec0478ca6f9";
sha256 = "sha256:0qjyfmw5v7s6ynjns4a61vlyj9cghj7vbpgrp9147ngb1f8krz2c";
};
2022-05-21 17:03:00 +00:00
2023-03-12 14:20:06 +00:00
tvlDepot = import ./tvl { nixpkgsBisectPath = ./nixpkgs; inherit nixpkgsConfig; nixpkgsSystem = system; };
2020-11-01 21:22:52 +00:00
in
rec {
2022-12-04 04:24:37 +00:00
inherit nixpkgsConfig nixpkgs;
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 // {
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;
2022-10-08 20:49:16 +00:00
copyToRoot = nixpkgs.buildEnv {
name = "${args.name}-env";
paths = 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 {};
2022-05-21 17:03:00 +00:00
gopkgs = readTree {
args = ch;
path = ./gopkgs;
2021-03-21 18:52:09 +00:00
};
2022-05-21 17:03:00 +00:00
bat_syntaxes = tvlDepot.third_party.bat_syntaxes;
cheddar = tvlDepot.tools.cheddar;
2021-03-21 18:52:09 +00:00
naersk = nixpkgs.callPackage naerskSrc {};
2020-11-01 21:39:25 +00:00
crate2nix = import "${crate2nixSrc}" { pkgs = ch.depot.pkgs; };
}