diff options
author | Klaus T. Aehlig <aehlig@linta.de> | 2025-06-14 14:35:26 +0200 |
---|---|---|
committer | Klaus T. Aehlig <aehlig@linta.de> | 2025-06-16 12:55:48 +0200 |
commit | 9e4e676260aa3205a79f0e8d280fb957f65eb89d (patch) | |
tree | 3b5f7c682377f3ef0125a3218361b6c931ddfb2a /doc | |
parent | a671faaa5cc432011ff60c0765042bc285ab9896 (diff) | |
download | bootstrappable-toolchain-9e4e676260aa3205a79f0e8d280fb957f65eb89d.tar.gz |
Documentation: describe how to programatically obtain host paths on NixOS
Diffstat (limited to 'doc')
-rw-r--r-- | doc/host-config.nix | 30 |
1 files changed, 30 insertions, 0 deletions
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 + ''; + +} |