[raspberry] add base image

i currently try building it and then check if it works
This commit is contained in:
2022-11-08 19:16:43 +01:00
parent e27351d1c3
commit b34e473865
3 changed files with 36 additions and 1 deletions

View File

@@ -53,6 +53,22 @@ to build a configuration run the following command (replace ```<hostname>``` wit
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
```
### building raspberry image
for the raspberry it is possible to build the whole configuration as an sd-card image which then can be flashed directly. more information about building arm on nixos can be found [here](https://nixos.wiki/wiki/NixOS_on_ARM).
to be able to build the image you need to enable qemu emulation on the machine you are building with. therefore it is necessary to add the following to your configuration.nix:
``` nix
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
```
then you can build the image with:
``` shell
nix build .#nixosConfigurations.rpi1_base_image.config.system.build.sdImage
```
### run a configuration as vm
to run a vm we have to build it first using the following command (replace ```<hostname>``` with the actual hostname):