feat(aya): qemu-aarch64 builder (disabled)

`binfmt_misc` does not currently work in containers...
This commit is contained in:
arcnmx 2024-05-11 12:54:36 -07:00
parent 0eb9efcd18
commit 767247cc91
3 changed files with 41 additions and 0 deletions

30
nixos/cross/aarch64.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs, config, lib, ... }: let
inherit (lib.options) mkEnableOption mkPackageOption;
inherit (lib.modules) mkIf;
cfg = config.boot.binfmt.cross.aarch64;
in {
options = {
boot.binfmt.cross.aarch64 = {
enable = mkEnableOption "qemu-aarch64" // {
default = true;
};
package = mkPackageOption pkgs "qemu" { };
armv7l = mkEnableOption "arm.cachix.org";
};
};
config = {
boot.binfmt = {
emulatedSystems = mkIf cfg.enable [ "aarch64-linux" ];
registrations.aarch64-linux = mkIf cfg.enable {
interpreter = "${cfg.package}/bin/qemu-aarch64";
wrapInterpreterInShell = false;
};
};
nix.settings = mkIf cfg.armv7l {
substituters = [ "https://arm.cachix.org/" ];
trusted-public-keys = [ "arm.cachix.org-1:5BZ2kjoL1q6nWhlnrbAl+G7ThY7+HaBRD9PZzqZkbnM=" ];
};
};
}