diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-10-28 10:04:14 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2021-10-29 11:34:01 +0200 |
commit | 93f8d59e4c71e6ff2f945dc2c632536f4530b13c (patch) | |
tree | 0d7171fd9c851b87d15bc3705eb394eb612d3ece /nix | |
parent | cc1caa87fbbc11338a650623c7776bf57402cd16 (diff) | |
download | garage-93f8d59e4c71e6ff2f945dc2c632536f4530b13c.tar.gz garage-93f8d59e4c71e6ff2f945dc2c632536f4530b13c.zip |
Extract toolchain build from the CIbug/rust-musl
Diffstat (limited to 'nix')
-rw-r--r-- | nix/nix.conf | 3 | ||||
-rw-r--r-- | nix/toolchain.nix | 29 |
2 files changed, 29 insertions, 3 deletions
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 + ] + |