-
-
Save 573/411885ce49e0b05456b6509268c1a2de to your computer and use it in GitHub Desktop.
AArch64 VM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgsPath ? <nixpkgs> }: | |
let | |
pkgs = import pkgsPath {}; | |
pkgsAarch64 = import pkgsPath { system = "aarch64-linux"; }; | |
iso = (pkgsAarch64.nixos { | |
imports = [ (pkgsPath + "/nixos/modules/installer/cd-dvd/installation-cd-base.nix") ]; | |
users.users.root.openssh.authorizedKeys.keyFiles = [(builtins.fetchurl https://github.com/lheckemann.keys)]; | |
}).config.system.build.isoImage; | |
vmScript = pkgs.writeScript "run-nixos-vm" '' | |
#!${pkgs.runtimeShell} | |
${pkgs.qemu}/bin/qemu-system-aarch64 \ | |
-machine virt,gic-version=max \ | |
-cpu max \ | |
-m 2G \ | |
-smp 4 \ | |
-drive file=$(echo ${iso}/iso/*.iso),format=raw,readonly=on \ | |
-nographic \ | |
-bios ${pkgsAarch64.OVMF.fd}/FV/QEMU_EFI.fd | |
''; | |
in vmScript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment