nix bundle fails on macos
Opened this issue · 2 comments
Describe the bug
When running e.g. nix bundle nixpkgs#hello
on aarch64-darwin
, it fails with the following error:
error: attribute 'aarch64-darwin' missing
at /nix/store/1rc10ydlf4c2aphrg2z2dxaaikbggba0-source/flake.nix:12:20:
11| nix-bundle = { program, system }: let
12| nixpkgs' = nixpkgs.legacyPackages.${system};
| ^
13| nix-bundle = import self { nixpkgs = nixpkgs'; };
Steps To Reproduce
- Use a macOS system with Apple Silicon
- Enable the
nix-command
andflakes
experimental features - Run
nix bundle nixpkgs#hello
- See error
Expected behavior
I would expect a self-extracting zip with the hello
command to be created.
nix-env --version
output
nix-env (Nix) 2.13.6
Additional context
Trying something like
nix bundle nixpkgs#legacyPackages.x86_64-linux.hello
results in the same error. I was originally trying to bundle murmur
for linux (using a build server which is set up) from my macOS machine when I ran into this error.
The upstream default bundler does not support aarch64-darwin: https://github.com/matthewbauer/nix-bundle/blob/master/flake.nix#L7 . This is very likely due to nix-user-chroot requiring linux namespaces... and well, not available on darwin.
It would be great to have this and to have "cross-bundling" better supported.
That would make it hard to support darwin, true 😅 Although it would still be nice to be able to start the bundling from my mac and have it run on the build server in the background. I did also run into the problem with namespaces when trying to run a completed bundle on an old CentOS7 machine, but that's a different problem altogether^^