From 93f8d59e4c71e6ff2f945dc2c632536f4530b13c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 28 Oct 2021 10:04:14 +0200 Subject: Extract toolchain build from the CI --- nix/nix.conf | 3 --- nix/toolchain.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 nix/toolchain.nix (limited to 'nix') diff --git a/nix/nix.conf b/nix/nix.conf index 8764eb3e..871efb10 100644 --- a/nix/nix.conf +++ b/nix/nix.conf @@ -2,6 +2,3 @@ substituters = https://cache.nixos.org https://nix.web.deuxfleurs.fr trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix.web.deuxfleurs.fr:eTGL6kvaQn6cDR/F9lDYUIP9nCVR/kkshYfLDJf1yKs= max-jobs = auto cores = 4 - -# required for containers -sandbox = false diff --git a/nix/toolchain.nix b/nix/toolchain.nix new file mode 100644 index 00000000..e8baa63a --- /dev/null +++ b/nix/toolchain.nix @@ -0,0 +1,29 @@ +{ + system ? builtins.currentSystem, +}: + +with import ./common.nix; + +let + platforms = [ + "x86_64-unknown-linux-musl" + "i686-unknown-linux-musl" + "aarch64-unknown-linux-musl" + "armv6l-unknown-linux-musleabihf" + ]; + pkgsList = builtins.map (target: import pkgsSrc { + inherit system; + crossSystem = { config = target; }; + }) platforms; + pkgsHost = import pkgsSrc {}; + lib = pkgsHost.lib; + kaniko = (import ./kaniko.nix) pkgsHost; +in + lib.flatten (builtins.map (pkgs: [ + pkgs.rustPlatform.rust.rustc + pkgs.rustPlatform.rust.cargo + pkgs.buildPackages.stdenv.cc + ]) pkgsList) ++ [ + kaniko + ] + -- cgit v1.2.3