summary refs log tree commit diff
path: root/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix
blob: a3e30768da4564162ab67b8984b38f7dab849d67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# To build, use:
# nix-build nixos -I nixos-config=nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix -A config.system.build.sdImage
{ config, lib, pkgs, ... }:

{
  imports = [
    ../../profiles/base.nix
    ./sd-image.nix
  ];

  boot.loader = {
    grub.enable = false;
    generic-extlinux-compatible = {
      enable = true;

      # Don't even specify FDTDIR - We do not have the correct DT
      # The DTB is generated by QEMU at runtime
      useGenerationDeviceTree = false;
    };
  };

  boot.consoleLogLevel = lib.mkDefault 7;
  boot.kernelParams = [ "console=tty0" "console=ttyS0,115200n8" ];

  sdImage = {
    populateFirmwareCommands = "";
    populateRootCommands = ''
      mkdir -p ./files/boot
      ${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
    '';
  };
}