Skip to content

Commit

Permalink
README: describe how emulate / run different architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Aug 14, 2024
1 parent 8a01034 commit 4fc5ae8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,20 @@ Or for a version closer to `nixos-shell`:
nix run .#nixosConfigurations.<yourmachine>.config.system.build.nixos-shell
```

## Running different architectures / operating systems i.e. Linux on MacOS

It's possible to specify a different architecture using `--guest-system`.
This requires your host system to have a either a remote builder
(i.e. [darwin-builder](https://github.com/NixOS/nixpkgs/blob/master/doc/packages/darwin-builder.section.md) on macOS)
or beeing able to run builds in emulation
for the guest system (`boot.binfmt.emulatedSystems` on NixOS.).

Here is an example for macOS (arm) that will run an aarch64-linux vm:

```
$ nixos-shell --guest-system aarch64-linux examples/vm.nix
```

## More configuration

Have a look at the [virtualisation] options NixOS provides.
Expand Down

0 comments on commit 4fc5ae8

Please sign in to comment.