diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | doc/host-config.nix | 30 |
2 files changed, 33 insertions, 0 deletions
@@ -227,6 +227,9 @@ Example configuration for bootstrapping on NixOS (hashes may vary): } ~~~ +On NixOS, the host configuration is most easily obtained using a custom derivation +obtained from a simple [host-configuration package](doc/host-config.nix). + ## Musl Performance Issues Musl has huge allocator contention issues with multithreading. For that reason, diff --git a/doc/host-config.nix b/doc/host-config.nix new file mode 100644 index 0000000..340598e --- /dev/null +++ b/doc/host-config.nix @@ -0,0 +1,30 @@ +{ stdenv +, jo +, coreutils +, gnused +, glibc +}: + +stdenv.mkDerivation rec { + name = "host-config"; + + unpackPhase=''true''; + + nativeBuildInputs = [ glibc jo coreutils gnused ]; + + buildPhase = '' + jo OS=linux \ + ARCH=$(uname -m | sed 's/aarch64/arm64/' ) \ + TOOLCHAIN_CONFIG=$(jo \ + HOST_SYSTEM_HDR_DIR=${glibc.dev}/include \ + HOST_SYSTEM_LIB_DIR=${glibc}/lib \ + HOST_DYNAMIC_LINKER=$(ls ${glibc}/lib/ld-linux-*.so*) \ + ) > host-config.json + ''; + + installPhase = '' + mkdir -p $out/share + cp host-config.json $out/share + ''; + +} |