I want to use a remote builder for my phone (aarch64-linux)
As I have a non-NixOS machine I tried to set up a vm with the binfmt wrapper enabled in its configuration.nix.
configuration.nix (vm-config.nix)
let
qemuOverlay = (import ./overlays/qemu);
in
{
imports = [
./qemu.nix
];
config = {
boot.kernelModules = [ "kvm-intel" ];
qemu-user.arm = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
nix = {
trustedUsers = [ "573" "builder" ];
};
users.users.builder = {
createHome = true;
isNormalUser = true;
};
};
}
vm.nix
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[ <nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
./vm-config.nix
];
system.build.qemuvmImage = import <nixpkgs/nixos/lib/make-disk-image.nix> {
inherit lib config;
pkgs = import <nixpkgs/nixos> { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
diskSize = 8192;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix"
''
{
imports = [ <./machine-config.nix> ];
}
'';
};
}
In the same folder I have both qemu.nix and the overlay structure.
When I run $ nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=vm.nix
it gives me
error: attribute ‘qemu-user-arm’ missing, at /home/573/remote-builder-nix/qemu.nix:11:22
though.
What am I missing here ?