summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--doc/host-config.nix30
2 files changed, 33 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5124a71..c8b618e 100644
--- a/README.md
+++ b/README.md
@@ -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
+ '';
+
+}