depot/third_party/default.nix

142 lines
4.4 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 = [
2023-08-19 21:13:16 +00:00
"nodejs-16.20.2" # for openvscode-server
2024-04-26 17:54:53 +00:00
"envoy-1.27.3"
"envoy-1.27.3-deps.tar.gz"
2024-06-08 23:54:09 +00:00
"python3.11-django-3.2.25"
# for authentik?
"python3.10-requests-2.29.0"
"python3.10-cryptography-40.0.2"
"python3.11-requests-2.29.0"
"python3.11-cryptography-40.0.2"
2020-11-01 21:22:52 +00:00
];
packageOverrides = pkgs: rec {
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 = "";
2023-12-14 11:17:59 +00:00
patches = oldAttrs.patches ++ [
./ntfy-0001-Swap-from-inspect.getargspec-to-inspect.signature-fo.patch
./ntfy-0003-Swap-description-file-for-description_file-to-make-s.patch
];
});
delve = pkgs.delve.overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // {
platforms = oldAttrs.meta.platforms ++ [ "aarch64-linux" ];
};
});
2023-12-14 11:30:26 +00:00
sofia_sip = pkgs.sofia_sip.overrideAttrs (oldAttrs: {
src = pkgs.fetchFromGitHub {
owner = "lukegb";
repo = "sofia-sip";
rev = "2e1e3117f4ab1b7dff7e2a70b238ba2ff7a90d11"; # tls-sni branch
sha256 = "0llayw2a5nir0zx3hx4wf3kvyjfb5gksxv6wagwfbc0cca5qp1nc";
};
});
freeswitch = pkgs.freeswitch.overrideAttrs (oldAttrs: {
src = pkgs.fetchFromGitHub {
owner = "lukegb";
repo = "freeswitch";
rev = "4f5a64c7912364ccb1059c64463daf06aaf49745"; # rtp-avpf-moz-variable
sha256 = "1jdyk6d80jmsg6qn7hw58088yydn78g3kn3lmgg8argihb69pf2i";
};
});
};
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;
};
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";
};
2024-03-01 23:49:17 +00:00
poetry2nixSrcRaw = nixpkgs.fetchFromGitHub {
2023-11-19 20:12:35 +00:00
owner = "nix-community";
repo = "poetry2nix";
2024-03-01 23:49:17 +00:00
rev = "3c92540611f42d3fb2d0d084a6c694cd6544b609";
hash = "sha256:1jfrangw0xb5b8sdkimc550p3m98zhpb1fayahnr7crg74as4qyq";
2023-11-19 20:12:35 +00:00
};
2024-03-01 23:49:17 +00:00
poetry2nixSrc = nixpkgs.runCommand "poetry2nix-patched" {
patches = [
./poetry2nix-cryptography-42.0.4.patch
];
src = poetry2nixSrcRaw;
} ''
cp -R $src $out
chmod -R +w $out
cd $out
for p in $patches; do
patch -p1 < "$p"
done
'';
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;
buildGo2 = tvlDepot.nix.buildGo2;
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; };
2023-11-19 20:12:35 +00:00
poetry2nix = import "${poetry2nixSrc}" { pkgs = ch.depot.pkgs; };
2024-03-01 14:23:22 +00:00
lanzaboote = import ./lanzaboote.nix { pkgs = nixpkgs; };
}