third_party/nix: introduce toolchain bundle

This introduces a nix derivation that builds a musl amd64/aarch64
toolchain sysroot.

Change-Id: Iba082edb8fd1f2ab580020bb1c7339a76487f3c8
Reviewed-on: https://review.monogon.dev/c/monogon/+/4006
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/third_party/nix/pkgs/diffutils/default.nix b/third_party/nix/pkgs/diffutils/default.nix
new file mode 100644
index 0000000..bbb38e3
--- /dev/null
+++ b/third_party/nix/pkgs/diffutils/default.nix
@@ -0,0 +1,39 @@
+{ pkgs }: with pkgs;
+if (!stdenv.hostPlatform.isStatic) then diffutils else
+diffutils.overrideAttrs (old: {
+  # Disable tests as they fail when static build.
+
+  # FAIL: test-getopt-gnu
+  #=====================
+  #
+  #test-getopt.h:661: assertion 'optind == 2' failed
+  #FAIL test-getopt-gnu (exit status: 134)
+  #
+  #FAIL: test-getopt-posix
+  #=======================
+  #
+  #test-getopt.h:661: assertion 'optind == 2' failed
+  #FAIL test-getopt-posix (exit status: 134)
+  #
+  #FAIL: test-nl_langinfo-mt
+  #=========================
+  #
+  #FAIL test-nl_langinfo-mt (exit status: 134)
+  #
+  #FAIL: test-random-mt
+  #====================
+  #
+  #FAIL test-random-mt (exit status: 134)
+  #
+  #FAIL: test-setlocale_null-mt-one
+  #================================
+  #
+  #FAIL test-setlocale_null-mt-one (exit status: 134)
+  #
+  #FAIL: test-setlocale_null-mt-all
+  #================================
+  #
+  #FAIL test-setlocale_null-mt-all (exit status: 134)
+  doCheck = false;
+  doInstallCheck = false;
+})