-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC 0125]: Use an intermediary representation (bootspec) for bootloader backends #125
Conversation
…r backends Bootspec is a set of memoized facts about a system's closure. These facts are used as the primary input for bootloader backends like systemd-boot and grub, for creating files in `/boot/loader/entries/` and `grub.cfg`. In this proposal we create a stable, comprehensive, and machine-parsable definition of a NixOS Generation as an intermediate representation (IR) between the NixOS system definition and the bootloader management tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The raspberrypi
bootloader should probably go away in some form, it's a horrible hack. Another thing for my bucket list...
Hey everyone, this RFC is open for shepherd nominations now |
…ghtly by integrating bootspec
I self-non-nominate. I suspect my nomination is otherwise likely (given my work/interest in the topic). I know from experience that I won't be able to attend to the duties for shepherding this RFC. I'm still open to ad-hoc questions and opinions though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall.
Relocate to $out/boot.json, top-level key of specification version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really convenient for kexec
-based bootloaders (petitboot, ownerboot, etc).
So yeah, device trees in bootspec would be great!
👍
we can work out how to do this in a future revision of bootspec.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to FCP, with disposition to accept!
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/bootspec-rfc-now-in-fcp/26598/1 |
Do I understand correctly that this makes NixOS depend on Cue? Since Cue is essentially a competing configuration language, making NixOS depend on that might send an unintended message (namely that Nix or the NixOS module system are inadequate). What do we need Cue for that we can't do with the NixOS module system? |
I'd argue that not using Nix for validation is actually the right call here, because it makes it easier for other systems to adopt bootspec should they want to (and I believe some people were vaguely interested in doing that before, at the very least from the Guix side). |
We only use it for schema validation, CUE is completely optional for this specification, you can bring your own schema validator if you need to. See manual on it: https://nixos.org/manual/nixpkgs/unstable/#id-1.5.8.11.5 |
Also, we cannot validate using the NixOS module because we are writing parts of the file in the derivation builder script. Therefore, we would need to run the NixOS module verification at that moment, which is painful for no reason. |
Why does the validator need to be executed on activation? This would imply a (afaik) new dependency on Go for every NixOS system. |
We did not want to ship broken configurations, but you are totally right, this is a problem. |
Can't we use JSON schemas for validation or is this more complex? |
It is more complicated than JSON schemas enable to express. |
Yeah that sounds good. I didn't even consider the build-time dependency on Go, but that's something to be avoided in the base system if at all possible. You're right this is an implementation issue, it doesn't really affect the RFC. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/boot-entry-management/29119/10 |
This introduces the second revision of RFC-0125, Bootspec, addressing the feedback we received in NixOS#125 and building on our experience of Bootspec v1.
This introduces the second revision of RFC-0125, Bootspec, addressing the feedback we received in NixOS#125 and building on our experience of Bootspec v1.
This introduces the second revision of RFC-0125, Bootspec, addressing the feedback we received in NixOS#125 and building on our experience of Bootspec v1.
This introduces the second revision of RFC-0125, Bootspec, addressing the feedback we received in NixOS#125 and building on our experience of Bootspec v1.
…der backends (NixOS#125) * RFC 0125: Use an intermediary representation (bootspec) for bootloader backends Bootspec is a set of memoized facts about a system's closure. These facts are used as the primary input for bootloader backends like systemd-boot and grub, for creating files in `/boot/loader/entries/` and `grub.cfg`. In this proposal we create a stable, comprehensive, and machine-parsable definition of a NixOS Generation as an intermediate representation (IR) between the NixOS system definition and the bootloader management tools. * bootspec: relocate to $out/bootspec/boot.v1.json * Clarify that this document describes bootspec v1 * Note that the filename must match the contained schemaVersion. * Replace the specialisation's pointer to a bootspec with the full bootspec document * Clarify the 'to interface with' bit * Link to the bootspec implementation PR * Note it is likely for bootloader backends to change their results slightly by integrating bootspec * Relocate to $out/boot.json, top-level key of specification version * Fix nits from code review Co-authored-by: Cole Helbling <[email protected]> Co-authored-by: Linus Heckemann <[email protected]> * 0125-bootspec: add the shepherd team and leader Co-authored-by: Kevin Cox <[email protected]> * 0125-bootspec: initrd is optional, add system, extensions, clarify the meaning of optional * PR: address comments (1) Co-authored-by: Cole Helbling <[email protected]> * PR: address comments (2) Co-authored-by: Cole Helbling <[email protected]> * Update RFC text with changes agreed on with RaitoBezarius --------- Co-authored-by: Cole Helbling <[email protected]> Co-authored-by: Cole Helbling <[email protected]> Co-authored-by: Linus Heckemann <[email protected]> Co-authored-by: Kevin Cox <[email protected]> Co-authored-by: Raito Bezarius <[email protected]>
Bootspec is a set of memoized facts about a system's closure.
These facts are used as the primary input for bootloader backends like
systemd-boot and grub, for creating files in
/boot/loader/entries/
and
grub.cfg
.In this proposal we create a stable, comprehensive, and machine-parsable
definition of a NixOS Generation as an intermediate representation (IR)
between the NixOS system definition and the bootloader management tools.
rendered
(thanks @ryantm)