Add documentation on how to build and run the VM

This commit is contained in:
TakeV 2023-03-29 20:44:55 -07:00
parent de6dc1d221
commit f64489a768
Signed by: TakeV
GPG Key ID: A64F41345C7400AF
2 changed files with 15 additions and 3 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
saturn/system.nix
saturn/system.nix

View File

@ -5,6 +5,18 @@ this is the basis of the saturnOS operating system ( sorry guix enjoyers )
to check for syntax errors, run `nix repl replEval.nix` and once inside the repl, run `imported` to
check for syntax errors
add the nixos channel 22.11
## Setup
add the nixos channel 22.11
`nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=default.nix`
## Building and Running
### VM
To build the VM:
`nix run github:nix-community/nixos-generators -- -c default.nix -f vm -o result/vm`
This will build the VM, and register the result in the `result/vm` symlink.
To run the VM, use `sudo result/vm/bin/run-qemu-vm`. (sudo can probably be avoided if you are in the KVM group... I think. TODO Lambda look this up)
You can combine the two steps with the following: `sudo $(nix run github:nix-community/nixos-generators -- -c default.nix -f vm -o result/vm)`
Or to build and run without registering a link (Good if you want a throw away VM which can be garbage collected): `sudo $(nix run github:nix-community/nixos-generators -- -c default.nix -f vm)`