Expose an iPXEWith to provide a cert bundle#44
Conversation
WalkthroughIntroduced a new exported factory Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
flake.nix (1)
60-66: Code is functionally correct; TRUST syntax is valid.The implementation properly uses the iPXE
TRUST=makefile parameter with the cert bundle path. While usingpkgs.lib.optionalis functionally equivalent topkgsX8664Linux.lib.optional(since lib is system-independent in nixpkgs), usingpkgsX8664Linux.libwould be a minor stylistic improvement for consistency with the package source being overridden.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
flake.nix(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: DeterminateCI / inventory
🔇 Additional comments (2)
flake.nix (2)
58-58: LGTM: Clean delegation to the new factory function.The refactoring correctly delegates to
iPXEWithwith no cert bundle, preserving the original behavior while enabling reuse.
154-156: LGTM: Clean usage of the new factory function.The refactoring correctly uses
iPXEWithwith the certificate bundle from the configuration option. The hardcodedx86_64-linuxsystem reference is appropriate for producing an x86_64 EFI binary.
8168f04 to
397d577
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
flake.nix (1)
51-60: TRUST makeFlag format is correct; function naming is a matter of style preference.The implementation properly uses iPXE's documented TRUST parameter format. The code
''TRUST=${certBundle}''correctly expands to a file path (e.g.,TRUST=/nix/store/...cert.pem) that iPXE's build system expects. The conditional injection vianixpkgs.lib.optionalis well-structured for optional certificate bundles.Renaming
mkiPXEtomkIPXEis optional—both naming conventions exist in Nix ecosystems and this is a stylistic preference rather than a technical concern.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
flake.nix(2 hunks)
🔇 Additional comments (2)
flake.nix (2)
68-68: LGTM! Good refactoring to use the factory.The refactoring eliminates duplication and centralizes the iPXE construction logic. The use of
self.lib.mkiPXEmakes it clear that this is using the standardized factory function.
156-159: LGTM! Excellent simplification.The refactoring successfully consolidates the cert bundle handling into the factory function. The
certBundleparameter is properly passed fromcfg.httpBootRootCertificate, making the cert injection mechanism clear and maintainable.
397d577 to
3094c6f
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
flake.nix (1)
51-60: Nice iPXE factory extraction; consider future‑proofingmakeFlagsCentralizing patch + TRUST handling in
lib.mkiPXEis a good cleanup and makes call sites simpler. To be a bit more robust against changes in the upstreamipxederivation, you could avoid assumingmakeFlagsis always present:- makeFlags = oldAttrs.makeFlags ++ (nixpkgs.lib.optional (certBundle != null) - ''TRUST=${certBundle}''); + makeFlags = (oldAttrs.makeFlags or []) ++ + (nixpkgs.lib.optional (certBundle != null) ''TRUST=${certBundle}'');This keeps behavior identical today while avoiding an attr‑missing failure if
makeFlagsever disappears upstream.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
flake.nix(2 hunks)
🔇 Additional comments (2)
flake.nix (2)
68-68: iPXE is now per‑system instead of hard‑wired to x86_64; double‑check this matches your matrixUsing
self.lib.mkiPXE { inherit system; }meanspackages.${system}.iPXEnow builds iPXE for each entry insupportedSystems, rather than always using an x86_64 nixpkgs set. This is probably what you want, but it does change the behavior for e.g.aarch64-linux/aarch64-darwinconsumers that might previously have been getting an x86_64 build viapkgsX8664Linux.If the intent was “always build the x86_64 iPXE image regardless of host system”, you may want to keep
system = "x86_64-linux"here instead.
156-159: ipxeX8664Efi default correctly reusesmkiPXEand wires in the cert bundleRefactoring the
ipxeX8664Efidefault to:
- always build from
mkiPXE { system = "x86_64-linux"; … }, and- pass
certBundle = cfg.httpBootRootCertificatekeeps the previous behavior (embed TRUST only when a bundle is configured, still targeting x86_64) while avoiding the duplicate
overrideAttrslogic. This looks correct and aligns the module default with the new factory.
3094c6f to
5cb2cbd
Compare
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.