summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorZhaofeng Li <hello@zhaofeng.li>2021-10-16 08:58:04 -0700
committerZhaofeng Li <hello@zhaofeng.li>2022-01-06 17:23:10 -0800
commit823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb (patch)
treeb936e99bcb319aba7dd8c15eb138491cd224e2f6 /nixos/modules/installer
parent16a907b00bc0aea1def4a39596fd745ad7705206 (diff)
downloadnixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar.gz
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar.bz2
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar.lz
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar.xz
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.tar.zst
nixpkgs-823acb25dd40392c1fc9f4bc5b7f5a369a6dd6eb.zip
sd-image-riscv64-qemu: init
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix b/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix
new file mode 100644
index 00000000000..bd2722af8ab
--- /dev/null
+++ b/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix
@@ -0,0 +1,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
+    '';
+  };
+}