Commit Graph

42 Commits

Author SHA1 Message Date
Aliaksandr
6ccc493231 nixos/limine: drop dead FWUPD_EFIAPPDIR override
fwupd stopped honouring the FWUPD_EFIAPPDIR environment variable in
https://github.com/fwupd/fwupd/pull/9846; the location is a compile-time
constant (`EFI_APP_LOCATION`) since then, so setting the variable on
fwupd.service had no effect.

Drop `RuntimeDirectory` from the signing unit too: the directory is now
created and populated by the fwupd module, and RuntimeDirectoryPreserve
defaults to `no`, so systemd removed it (together with the unsigned app)
whenever the unit stopped -- which `partOf = fwupd.service` makes happen
on every fwupd restart.

Cover the whole path in the limine secure boot test, which so far never
enabled fwupd: it now asserts that both the unsigned app and the signed
variant end up in /run/fwupd-efi.

Assisted-by: claude-code with claude-opus-5[1m]-high
2026-08-16 01:42:28 +03:00
Morgan Jones
764a4ebdf2 nixos/limine: don't read all of /nix/store during installation
The installer being placed directly at (e.g.)
/nix/store/272h8d4df6by64ycl3s01bixrcaq5a9a-limine-install.py causes
Python to search the script's directory for imports if -P is not added,
so add -P to avoid Python automatically adding /nix/store to the script's
sys.path.

From the python manpage:

> -P: Don't automatically prepend a potentially unsafe path to sys.path
> such as the current directory, the script's directory or an empty string.
> See also the PYTHONSAFEPATH environment variable.
2026-08-02 05:24:15 -07:00
phanirithvij
4abe0c81a7 various: replace deprecated os.system with subprocess calls
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
2026-07-13 16:27:07 +05:30
Florian Klink
22ef2ba154 nixos/limine: fix location for boot.loader.limine.additionalFiles
The documentation describes this as a set of files copied to /boot, with
the attribute name denoting the destination file name in /boot.

This uses essentially the same description as refind, systemd-boot and
grub. However limine put it into limine_install_dir (/boot/limine by
default) by accident, which broke downstream users.

For example, nixos-apple-silicon uses boot.loader.limine.additionalFiles
(and similar directives for other bootloaders) to update its m1n1
bootloader (which chainloads into u-boot, which chainloads into the
bootloader selected in NixOS), and due to this bug, put new versions of
it in the wrong location, effectively never updating m1n1.

Fix this, by updating the location. The next commit adds a regression VM
test for it.
2026-07-07 23:14:45 +03:00
r-vdp
5f267f4dda nixos/boot: allow passing extra initrd archives to the bootloader
This is for instance useful on Asahi where an additional initrd archive
containing firmware blobs and per-device calibration files is placed
on the ESP and updated by the Asahi Linux Installer.
These need to be loaded alongside the NixOS initrd.

Implemented for systemd-boot and Limine. Grub is left out since its
install script does not use bootspec yet.

Co-authored-by: Florian Klink <flokli@flokli.de>
2026-06-26 13:39:08 +03:00
r-vdp
5640e1f935 nixos/limine: add extraInstallCommands option
Allows running additional shell commands after the limine install script
generates menu entries, mirroring the systemd-boot option of the same
name.

Co-authored-by: Florian Klink <flokli@flokli.de>
2026-06-25 22:58:22 +02:00
r-vdp
b3a73f17ba nixos/limine: format the install script 2026-06-22 16:21:35 +02:00
Masum Reza
0c505d8bfa nixos/limine: fix secure boot key generation when using impermanence (#514762) 2026-06-17 04:57:48 +00:00
Aliaksandr
e5ec5c94d8 nixos/limine: fix fwupd-efi signing script under strict shell checks
The signing service builds `fwupd_efi` as a bash array but referenced
it as a scalar, tripping SC2128 (array expanded without index) and
SC2046 (unquoted command substitution). With enableStrictShellChecks
these are promoted to errors, breaking the unit-script build when
secureBoot, fwupd and strict shell checks are all enabled.

Loop over the array and sign every matched fwupd EFI binary, quoting
the basename and the -o argument. Indexing a single element would
silently skip any additional files the glob matches.

Assisted-by: claude-code with claude-opus-4-8[1m]-high
2026-06-02 02:46:28 +03:00
Viktor Fedorov
c982604bb8 nixos/limine: correct timeout logic
Although the documentation for `boot.loader.timeout` says to use `null` for an indefinite display, in limine nixos module it incorrectly sets `10` instead of `no`. https://github.com/Limine-Bootloader/Limine/blob/v12.x/CONFIG.md
2026-05-23 19:30:36 +02:00
Ryan Omasta
94a009f821 nixos/limine: fix option_from_config to use yes/no values 2026-05-07 21:05:54 -06:00
Ryan Omasta
833fe2d511 nixos/limine: add helpColor and helpColorBright options 2026-05-02 14:30:55 -06:00
programmerlexi
027454c0ee nixos/limine: fix secure boot key generation when using impermanence 2026-04-29 17:48:42 +02:00
Sizhe Zhao
bea3efecfa nixos/limine: disable editor for secure boot 2026-04-26 10:51:51 +08:00
Léana 江
3a8c4e697c nixos/limine: pass distroName using JSON 2026-04-05 14:28:35 +02:00
Léana 江
450c46303f nixos/limine: show config.system.nixos.distroName value in menu
Previously the entry section always shows "NixOS".
Now it would show the value configured in config.system.nixos.distroName.
2026-04-04 10:57:57 +02:00
Masum Reza
21601ecc68 nixos/limine: add settings autoGenerateKeys & autoEnrollKeys (#486777) 2026-04-03 18:12:28 +00:00
lwb
c3f0c3ec35 nixos/limine: add settings autoGenerateKeys & autoEnrollKeys 2026-03-07 12:16:33 +08:00
programmerlexi
081365d23d nixos/limine: change name of signed fwupd file 2026-02-13 13:50:31 +01:00
Philip Taron
ffffc8aaa1 nixos/limine: add resolution option for Linux boot entries
Add boot.loader.limine.resolution option to control the framebuffer
resolution that Limine sets via GOP before booting Linux. This affects
early boot graphics drivers like simpledrm and efifb.

This is distinct from style.interface.resolution which only controls
the Limine bootloader's own menu interface - the new option sets the
per-entry "resolution:" directive in limine.conf which calls
gop->SetMode() to change the actual framebuffer resolution before
handing off to the kernel.

Example usage:
  boot.loader.limine.resolution = "3840x1600x32";

This enables users to get native resolution early boot graphics
instead of being limited to whatever GOP mode the UEFI firmware
provides by default (often 1024x768).
2026-01-15 11:29:08 -08:00
jamie
754edf0e23 limine: fix typo ('streched' to 'stretched') 2025-11-07 22:12:27 +00:00
Sizhe Zhao
b8af8f2e3d limine: convert boolean values 2025-10-20 02:36:44 +08:00
Sizhe Zhao
3fbc40c0ac nixos/limine: forceMbr -> force 2025-10-06 21:48:31 +08:00
Rane
77448445c1 nixos/limine: fix install script when using Xen with EFI (#441473) 2025-09-10 08:55:40 +10:00
Acid Bong
68dacf00f4 nixos/limine: use SBctl from the option 2025-09-03 01:12:09 +05:30
Rane
647c04f2e9 nixos/limine: Add support for booting Xen 2025-08-30 14:43:43 +10:00
Alex Lyon
38ee02a873 nixos/limine: fix installation when using initrd secrets 2025-08-01 21:59:49 +05:30
sanana
6baed48380 limine-install: fix profile enumeration
Fixes #425158.
2025-07-15 13:49:05 +05:30
Masum Reza
a2b5af4710 limine-install: cleanup, improve type hinting (#416188) 2025-06-23 23:08:45 +05:30
Masum Reza
4c902775b8 nixos/limine: make the install script more resilent (#413390) 2025-06-03 20:40:14 +05:30
programmerlexi
2c673b6e67 nixos/limine: fix boot entry not being created properly (#410935) 2025-05-26 13:19:36 +05:30
John Titor
88d5e40fcb limine, nixos/limine, nixosTests.limine: inherit pkgs.limine maintainers
also adds @programmerlexi to limine package maintainers

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-05-23 15:06:50 +05:30
hustlerone
de6905ee37 nixos/limine: tidy up the boot menu 2025-05-22 20:45:00 +05:30
programmerlexi
95030d7eb3 nixos/limine: don't modify boot order on bootloader update 2025-05-21 23:17:42 +05:30
programmerlexi
36ecfe6216 nixos/limine: add support for secure boot
Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-05-21 21:59:23 +05:30
programmerlexi
a094b5d8cc nixos/limine: carefully remove files instead of nuking them 2025-05-21 15:22:45 +05:30
programmerlexi
2c7659b1ff nixos/limine: atomically copy files 2025-05-21 15:22:45 +05:30
nat
e51e0da386 nixos/limine: substituteAll -> replaceVarsWith 2025-05-13 23:14:43 +02:00
Angelo Bulfone
9ed29c65a4 nixos/limine: Fix reading generations and specialisations
Previously, all generations for the primary system profile
read their data from the currently active one rather than
their own path, and specialisations in general all used
their parent bootspec rather than their own. This fixes both issues.

This commit still uses the parent path's build date for
specialisations, but this is more minor issue and the times
shouldn't be meaningfully different in most cases anyways.
2025-03-19 15:19:41 -07:00
programmerlexi
1a830fe9d9 nixos/limine: fix the install script 2025-03-18 01:06:55 +05:30
Rane
2cc1d33489 nixos/limine: cast partition index to string (#390732) 2025-03-18 01:01:15 +05:30
programmerlexi
12779dc091 nixos/limine: init module
Co-Authored-By: Gabriel Waksmundzki <czapek1337@gmail.com>
2025-03-06 08:05:08 +01:00