Following the nix instructions on macos aarch64, I had no trouble getting the repl working, but I'm struggling with the devtools. As you can see below, LLVM_SYS_130_PREFIX
works fine from inside the roc
environment, but can't be found when building roc-devtools. Any help would be appreciated.
roc % nix develop
Restored session: Sat 23 Sep 2023 09:55:30 BST
Johns-MacBook-Pro:roc john$ echo $LLVM_SYS_130_PREFIX
/nix/store/fvs60mzmhnqgpj2js7qij36irnwq2qpw-llvm-13.0.1-dev
Johns-MacBook-Pro:roc john$ exit
exit
Saving session...
...saving history...truncating history files...
...completed.
roc % cd ../roc-devtools
roc-devtools % nix develop
warning: Git tree '/Users/john/Git/roc-devtools' is dirty
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'nix-shell'
whose name attribute is located at /nix/store/8qr2x85z4rkf7rca3pk1dfyzsi60j7r2-source/pkgs/stdenv/generic/make-derivation.nix:300:7
… while evaluating attribute 'LLVM_SYS_130_PREFIX' of derivation 'nix-shell'
at /nix/store/jhcviv44hxx2bqbx4s439j92cdbfxnmw-source/flake.nix:48:11:
47| # env vars
48| LLVM_SYS_130_PREFIX = rocShell.LLVM_SYS_130_PREFIX;
| ^
49| NIX_GLIBC_PATH = rocShell.NIX_GLIBC_PATH;
error: attribute 'LLVM_SYS_130_PREFIX' missing
at /nix/store/jhcviv44hxx2bqbx4s439j92cdbfxnmw-source/flake.nix:48:33:
47| # env vars
48| LLVM_SYS_130_PREFIX = rocShell.LLVM_SYS_130_PREFIX;
| ^
49| NIX_GLIBC_PATH = rocShell.NIX_GLIBC_PATH;
Hi John,
I'll try to reproduce and fix this issue today
Can you try out my devtools-nix-fix branch @John Colvin? It's best to start from scratch with the steps mentioned in the README .
Thanks for helping so fast. That gives me a new error:
roc-devtools % nix develop
warning: Git tree '/Users/john/Git/roc-devtools' is dirty
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'nix-shell'
whose name attribute is located at /nix/store/8qr2x85z4rkf7rca3pk1dfyzsi60j7r2-source/pkgs/stdenv/generic/make-derivation.nix:300:7
… while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell'
at /nix/store/8qr2x85z4rkf7rca3pk1dfyzsi60j7r2-source/pkgs/stdenv/generic/make-derivation.nix:344:7:
343| depsBuildBuild = lib.elemAt (lib.elemAt dependencies 0) 0;
344| nativeBuildInputs = lib.elemAt (lib.elemAt dependencies 0) 1;
| ^
345| depsBuildTarget = lib.elemAt (lib.elemAt dependencies 0) 2;
error: Package ‘gdb-13.2’ in /nix/store/8qr2x85z4rkf7rca3pk1dfyzsi60j7r2-source/pkgs/development/tools/misc/gdb/default.nix:140 is not available on the requested hostPlatform:
hostPlatform.config = "aarch64-apple-darwin"
package.meta.platforms = [
"aarch64-linux"
"armv5tel-linux"
"armv6l-linux"
"armv7a-linux"
"armv7l-linux"
"i686-linux"
"loongarch64-linux"
"m68k-linux"
"microblaze-linux"
"microblazeel-linux"
"mips-linux"
"mips64-linux"
"mips64el-linux"
"mipsel-linux"
"powerpc64-linux"
"powerpc64le-linux"
"riscv32-linux"
"riscv64-linux"
"s390-linux"
"s390x-linux"
"x86_64-linux"
"i686-cygwin"
"x86_64-cygwin"
"x86_64-darwin"
]
package.meta.badPlatforms = [ ]
, refusing to evaluate.
a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
(Flake) command, `--impure` must be passed in order to read this
environment variable.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.
I removed gdb
and vadimcn.vscode-lldb
from flake.nix
, finally got it building. I think maybe the template needs some adjustment for macos-aarch64 users.
:+1: I'll add a CI test on macos-aarch64 and modify the file as needed
Your fixes have been applied @John Colvin and are now available on the main branch. I've also added a test for the devtools flake on macos aarch64.
Last updated: Jul 06 2025 at 12:14 UTC