From 61b30678c4158b8f892e2d421da20dc78465952a Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 13 Aug 2025 17:53:46 +0000 Subject: [PATCH] all: switch bootloader from syslinux -> systemd-boot (except for moby -- TODO) --- TODO.md | 3 +++ hosts/by-name/moby/default.nix | 4 ++++ hosts/common/boot.nix | 3 ++- modules/image.nix | 1 + scripts/deploy | 2 +- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index e150eb37c..e8d2a3b40 100644 --- a/TODO.md +++ b/TODO.md @@ -57,6 +57,9 @@ ## IMPROVEMENTS: +- servo: expand /boot to 2 GiB like all other hosts +- moby: port to systemd-boot +- image builder: make sure i distribute EFI/BOOT/BOOTX64.efi (as systemd-boot) - sane-deadlines: show day of the week for upcoming items - and only show on "first" terminal opened; not on Ctrl+N terminals - curlftpfs: replace with something better diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index 319be3869..394c1cde5 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -60,4 +60,8 @@ # /boot space is at a premium, especially with uncompressed kernels. default was 20. # boot.loader.generic-extlinux-compatible.configurationLimit = 10; + + # TODO: switch to systemd-boot + boot.loader.generic-extlinux-compatible.enable = true; + boot.loader.systemd-boot.enable = false; } diff --git a/hosts/common/boot.nix b/hosts/common/boot.nix index 9204c0f22..397dc9d38 100644 --- a/hosts/common/boot.nix +++ b/hosts/common/boot.nix @@ -37,7 +37,8 @@ boot.consoleLogLevel = 7; boot.loader.grub.enable = lib.mkDefault false; - boot.loader.generic-extlinux-compatible.enable = lib.mkDefault true; + # boot.loader.generic-extlinux-compatible.enable = lib.mkDefault true; + boot.loader.systemd-boot.enable = lib.mkDefault true; hardware.enableAllFirmware = true; # firmware with licenses that don't allow for redistribution. fuck lawyers, fuck IP, give me the goddamn firmware. # hardware.enableRedistributableFirmware = true; # proprietary but free-to-distribute firmware (extraneous to `enableAllFirmware` option) diff --git a/modules/image.nix b/modules/image.nix index 4430c65bf..7bd5cd7cd 100644 --- a/modules/image.nix +++ b/modules/image.nix @@ -382,6 +382,7 @@ in '' ); + # TODO: generalize this beyond just `generic-extlinux-compatible`. use `system.build.installBootLoader`? sane.image.extraBootFiles = lib.optionals config.boot.loader.generic-extlinux-compatible.enable [ (pkgs.runCommandLocal "populate-extlinux" {} '' ${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d "$out" diff --git a/scripts/deploy b/scripts/deploy index 5ca1cbbb2..d5407c020 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -302,7 +302,7 @@ proc deployOneHost (; nixcfg) { # try to switch to that profile _now_, but allow this to be fallible # so as to support `--force-reboot` CLI option: try { - destructive runOnTarget "$netHost" sudo "$myStorePath/bin/switch-to-configuration" "$[nixcfg.action]" + destructive runOnTarget "$netHost" sudo NIXOS_INSTALL_BOOTLOADER=1 "$myStorePath/bin/switch-to-configuration" "$[nixcfg.action]" } var fail = false if failed { setvar fail = true } # XXX: `failed` special variable is only readable via `if failed`