about summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd
diff options
context:
space:
mode:
authorThomas Kerber <tk@drwx.org>2019-08-17 17:42:22 +0100
committerThomas Kerber <tk@drwx.org>2019-09-17 04:05:16 +0100
commitcc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0 (patch)
treebf311377d69ed13987867bdc75ba1be92a3f9e71 /nixos/modules/installer/cd-dvd
parent7f523f4d7e1f6eea06094e59ab6f55730ec0eb2e (diff)
downloadnixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar.gz
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar.bz2
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar.lz
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar.xz
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.tar.zst
nixlib-cc5baf2d8671d2f2dd9e00fc8bbc96d769ec27e0.zip
Various: Add support for raspberry pi 4.
Diffstat (limited to 'nixos/modules/installer/cd-dvd')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix2
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix31
2 files changed, 32 insertions, 1 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
index 2a131d9ce980..ba4127eaa0e8 100644
--- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
+++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
@@ -19,7 +19,7 @@ in
   boot.loader.generic-extlinux-compatible.enable = true;
 
   boot.consoleLogLevel = lib.mkDefault 7;
-  boot.kernelPackages = pkgs.linuxPackages_rpi;
+  boot.kernelPackages = pkgs.linuxPackages_rpi1;
 
   sdImage = {
     populateFirmwareCommands = let
diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix
new file mode 100644
index 000000000000..c545a1e7e242
--- /dev/null
+++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix
@@ -0,0 +1,31 @@
+# To build, use:
+# nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix -A config.system.build.sdImage
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    ../../profiles/base.nix
+    ../../profiles/installation-device.nix
+    ./sd-image.nix
+  ];
+
+  boot.loader.grub.enable = false;
+  boot.loader.raspberryPi.enable = true;
+  boot.loader.raspberryPi.version = 4;
+  boot.kernelPackages = pkgs.linuxPackages_rpi4;
+
+  boot.consoleLogLevel = lib.mkDefault 7;
+
+  sdImage = {
+    firmwareSize = 128;
+    # This is a hack to avoid replicating config.txt from boot.loader.raspberryPi
+    populateFirmwareCommands =
+      "${config.system.build.installBootLoader} ${config.system.build.toplevel} -d ./firmware";
+    # As the boot process is done entirely in the firmware partition.
+    populateRootCommands = "";
+  };
+
+  # the installation media is also the installation target,
+  # so we don't want to provide the installation configuration.nix.
+  installer.cloneConfig = false;
+}