aboutsummaryrefslogtreecommitdiff
path: root/nix/toolchain.nix
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-10-28 10:04:14 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-10-29 11:34:01 +0200
commit93f8d59e4c71e6ff2f945dc2c632536f4530b13c (patch)
tree0d7171fd9c851b87d15bc3705eb394eb612d3ece /nix/toolchain.nix
parentcc1caa87fbbc11338a650623c7776bf57402cd16 (diff)
downloadgarage-93f8d59e4c71e6ff2f945dc2c632536f4530b13c.tar.gz
garage-93f8d59e4c71e6ff2f945dc2c632536f4530b13c.zip
Extract toolchain build from the CIbug/rust-musl
Diffstat (limited to 'nix/toolchain.nix')
-rw-r--r--nix/toolchain.nix29
1 files changed, 29 insertions, 0 deletions
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
+ ]
+