From ef707de8b13b240fad2ec3d58003d6ad17419e20 Mon Sep 17 00:00:00 2001
From: Daniel Barlow <dan@telent.net>
Date: Fri, 2 Feb 2024 19:51:41 +0000
Subject: [PATCH] add extlinux in recovery example

this needlessly bloats the TFTP image, which is a shame, but is
needed for installing onto usb stick
---
 examples/recovery.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/recovery.nix b/examples/recovery.nix
index 79c6982..ddd4e94 100644
--- a/examples/recovery.nix
+++ b/examples/recovery.nix
@@ -22,6 +22,7 @@ in rec {
     ../modules/outputs/ubimage.nix
     ../modules/outputs/jffs2.nix
     ../modules/outputs/ext4fs.nix
+    ../modules/outputs/extlinux.nix
   ];
 
   kernel.config = {
@@ -33,6 +34,7 @@ in rec {
     serverip = "10.0.0.1"; # build machine or other tftp server
     freeSpaceBytes = 1024 * 1024 * 4;
   };
+  boot.loader.extlinux.enable = true;
 
   hostname = "recovery";
 
@@ -83,9 +85,11 @@ in rec {
     mnt = dir {};
   };
   rootfsType = "ext4";
+
   # sda is most likely correct for the boot-from-USB case. For tftp
   # it's overridden by the boot.scr anyway, so maybe it all works out
-  hardware.rootDevice = "/dev/sda1";
+  hardware.rootDevice = lib.mkForce "/dev/sda1";
+
   users.root = {
     # the password is "secret". Use mkpasswd -m sha512crypt to
     # create this hashed password string