aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/nix.conf3
-rw-r--r--nix/toolchain.nix29
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
+ ]
+