| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- # NOTE: use `sudo launchctl stop org.nixos.linux-builder` to stop VM
- { lib, ... }:
- let
- systems = [
- "aarch64-linux"
- "x86_64-linux"
- ];
- in
- {
- nix.linux-builder = {
- enable = true;
- ephemeral = true;
- maxJobs = 4;
- inherit systems;
- supportedFeatures = [
- "kvm"
- "benchmark"
- "big-parallel"
- "nixos-test"
- ];
- config = {
- # Enable x86_64 emulation
- boot.binfmt.emulatedSystems = [ "x86_64-linux" ];
- virtualisation = {
- darwin-builder = {
- diskSize = 50 * 1024;
- memorySize = 8 * 1024;
- };
- cores = 6;
- msize = 128 * 1024;
- };
- };
- };
- nix.settings.extra-platforms = systems;
- nix.settings.system-features = [
- "nixos-test"
- "apple-virt"
- "benchmark"
- "big-parallel"
- "kvm"
- ];
- # Keep your logs! They are vital when the VM fails to boot.
- launchd.daemons.linux-builder = {
- serviceConfig = {
- StandardOutPath = "/var/log/darwin-builder.log";
- StandardErrorPath = "/var/log/darwin-builder.log";
- KeepAlive = lib.mkForce false;
- };
- };
- }
|