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:31:17 -0800
commit2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0 (patch)
treef7bbdd8d5e49c1b25194e5a80b531e7ff8aa790a /nixos/modules/installer
parentb70c23ea61e88f6e6de55f3fb9c9c09ebb308e2a (diff)
downloadnixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar.gz
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar.bz2
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar.lz
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar.xz
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.tar.zst
nixpkgs-2cb7743e9c0f5c525c33ae2bccc7af30aefd97f0.zip
sd-image-x86_64: init
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix2
-rw-r--r--nixos/modules/installer/sd-card/sd-image-x86_64.nix27
2 files changed, 28 insertions, 1 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
index bd2722af8ab..a3e30768da4 100644
--- a/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix
+++ b/nixos/modules/installer/sd-card/sd-image-riscv64-qemu.nix
@@ -20,7 +20,7 @@
   };
 
   boot.consoleLogLevel = lib.mkDefault 7;
-  boot.kernelParams = ["console=tty0" "console=ttyS0,115200n8"];
+  boot.kernelParams = [ "console=tty0" "console=ttyS0,115200n8" ];
 
   sdImage = {
     populateFirmwareCommands = "";
diff --git a/nixos/modules/installer/sd-card/sd-image-x86_64.nix b/nixos/modules/installer/sd-card/sd-image-x86_64.nix
new file mode 100644
index 00000000000..b44c0a4eeca
--- /dev/null
+++ b/nixos/modules/installer/sd-card/sd-image-x86_64.nix
@@ -0,0 +1,27 @@
+# To build, use:
+# nix-build nixos -I nixos-config=nixos/modules/installer/sd-card/sd-image-x86_64.nix -A config.system.build.sdImage
+
+# This image is primarily used in NixOS tests (boot.nix) to test `boot.loader.generic-extlinux-compatible`.
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../profiles/base.nix
+    ./sd-image.nix
+  ];
+
+  boot.loader = {
+    grub.enable = false;
+    generic-extlinux-compatible.enable = true;
+  };
+
+  boot.consoleLogLevel = lib.mkDefault 7;
+
+  sdImage = {
+    populateFirmwareCommands = "";
+    populateRootCommands = ''
+      mkdir -p ./files/boot
+      ${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
+    '';
+  };
+}