34 lines
728 B
Nix
34 lines
728 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [ ];
|
|
|
|
options.me = {
|
|
emulate_isa.enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
example = true;
|
|
description = "Whether we want to enable emulating other CPU architectures.";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.me.emulate_isa.enable (
|
|
lib.mkMerge [
|
|
{
|
|
boot.binfmt.emulatedSystems = [
|
|
"aarch64-linux" # Raspberry Pi gen 3
|
|
"riscv64-linux"
|
|
# TODO: Should "x86_64-linux" be in this list or should this list be dependent on the host CPU?
|
|
"armv6l-linux" # Raspberry Pi gen 1
|
|
];
|
|
}
|
|
]
|
|
);
|
|
}
|
|
# NOTE: build nixosConfigurations.<name>.config.system.build.sdImage
|