-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote builder (using qemu for aarch64)? #62
Comments
I don't, and I'd like to learn how to do it as well. Note, that the performance likely won't be great with QEMU ARM emulation either. I wouldn't be surprised if faster IO due to the lack of proot would be the deciding factor, and not the CPU performance. |
I think it's working but really really slow. I'm using the qemu overlay from https://github.com/bqv/nixos (thanks to qy on the matrix channel). qemux.nix: https://github.com/bqv/nixos/blob/live/profiles/misc/qemu.nix I'm creating a "builder" user on the builder machine. builder host configuration.nix let
qemuOverlay = (import ./overlays/qemu);
in
{
imports = [ ./qemu.nix ];
boot.kernelModules = [ "kvm-intel" ];
qemu-user.arm = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
nix = {
trustedUsers = [ "bbigras" "builder" ];
};
users.users.builder = {
createHome = true;
isNormalUser = true;
# I should probably add the ssh pub key here
};
} on Android:
~/.ssh/config
~/.ssh/nix_remote is an ssh key without a password. I added the pub key on the builder machine. you need to ssh first to the host to make ssh accept the host key. You can test with or |
Cool. Could you please add this to https://github.com/t184256/nix-on-droid/wiki, so that it ain't buried in a closed issue? |
Yes no problem. I have a question. Why bat needs to be built when running
|
I'm afraid I don't know. |
Maybe its due to the bionic build env? I don't really understand that in detail but wasn't this the reason proot hash is different when compiled on the build host vs the phone? @t184255 |
No, it's not. Inside proot we don't use bionic. |
@bbigras, is it possible to check if your builder would use the cache if you use same channel url? And will the hashes match? |
Sorry it took me a whole month to reply. I just added the stuff to the wiki.
Like this?
|
On Android bat seems to come from the cache right now. I'll check if it's the same hashes. |
If I run Maybe the problem with bat is gone. Is there any way to know which derivations need to be built? |
If we forget the remote builder for a sec. If I want run nix-on-droid but only use cached stuff, no local build, can I use |
Try to run |
Thanks everyone. My nix-on-droid doesn't seem to want to build stuff currently. Maybe I was on a different channel before I wiped to make openssh work. I'll open a new issue if I see it again in the future. |
Hi @bbigras, what you had set up there is exactly the use case me and sure many others aim for. I wanted to try this as well. To better get a grip how things relate and since I do not own a machine with NixOS installed and hence have no
To build the vm I would now i. e. run:
but that gives me
How is that ? EDIT: |
Building according to the steps given just works assumed you install the binfmt wrapper on the system powered by the remote machine, the system being whatever you like. In case of a non-NixOS remote you also safely would ignore the configuration.nix, qemu.nix and overlay changes. Consider my previous comments describing a niché case where you tried to let that remote machine just be a virtual one (running in qemu). FYI, I leave a tracking link here, where I discuss approaching a working template. |
Sorry for the gruft added by the last two posts. |
I find the page confusing, TBH. It elaborates on https://github.com/t184256/nix-on-droid/wiki/Use-a-remote-builder-with-qemu, and enhances it with a way to spawn such builder VMs on anything Nix-capable, right? Could you somehow make it more clear in the introduction? Also, wow, let's offload compilation from Nix-on-Droid to WSL1. You, sir, win a unique setup award. |
@t184256 thx I'm honored lol. But yes indeed using this approach I'm able to compile packages for nix-on-droid the aarch64 architecture on a vm spawned as you said exactly. the vm running nixos but the metal spawning the vm just using nix which latter part is just conveniency. EDIT: the point is that to achieve what the other article describes on a Windows-operated machine i. e. spawning qemu-user I need some virtualization approach I am trying to make the article more comprehensive with a better intro soon. Thanks for your input. |
Thanks for following through! I definitely like the new version better. |
I think many packages need to be compiled on my phone when I update. I takes a while and use my battery.
Anyone uses a remote builder? I wonder how to set up a remote builder using qemu to build the aarch64 packages for android on my x86_64 machine.
The text was updated successfully, but these errors were encountered: