1# To build, use:
2# nix-build nixos -I nixos-config=nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix -A config.system.build.sdImage
3{ config, lib, pkgs, ... }:
4
5{
6 imports = [
7 ../../profiles/base.nix
8 ./sd-image.nix
9 ];
10
11 boot.loader = {
12 grub.enable = false;
13 generic-extlinux-compatible = {
14 enable = true;
15
16 # Don't even specify FDTDIR - We do not have the correct DT
17 # The DTB is generated by QEMU at runtime
18 useGenerationDeviceTree = false;
19 };
20 };
21
22 boot.consoleLogLevel = lib.mkDefault 7;
23 boot.kernelParams = [ "console=tty0" "console=ttyS0,115200n8" ];
24
25 sdImage = {
26 populateFirmwareCommands = "";
27 populateRootCommands = ''
28 mkdir -p ./files/boot
29 ${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
30 '';
31 };
32}