Decouple encryption from debug profile#1756
Merged
brianmcgillion merged 5 commits intotiiuae:mainfrom Feb 15, 2026
Merged
Conversation
Add interactiveSetup and debugTools options to ghaf.storage.encryption so partitioning modules no longer cross-reference config.ghaf.profiles. debug.enable. This eliminates a cross-bundle coupling that causes undefined option errors when importing the partitioning bundle without the profiles bundle. The debug profile sets these options via mkDefault, preserving existing behavior for all upstream targets while making the partitioning modules independently importable by downstream consumers. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
In qemu.nix, replace builtins.hasAttr checks on qemuExtraArgs sub-attributes with Nix `or []` fallback syntax, which is both safer and more idiomatic. In host-hardening.nix, remove the hasAttr guards for ghaf.host and ghaf.host.secureboot. This module is only accessible through the profiles bundle which always imports common (and thus secureboot.nix), so these attributes are always defined. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
Move ghaf.storagevm option declarations from modules/microvm/common/storagevm.nix into a new modules/common/storage-persistence.nix file that is imported by the common bundle. This allows modules in common, desktop, and reference bundles to contribute persistent directories/files without requiring the microvm bundle to be imported. Replace all hasAttr "storagevm" guards in 11 consumer files with direct config.ghaf.storagevm.enable checks, which is both more idiomatic and avoids the anti-pattern of runtime option existence checks. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
In createFakeBattery.nix (common bundle), replace the hasAttr "definition" guard with an `or "unknown"` fallback, which avoids evaluation failure when the hardware bundle is not imported. In usb-static.nix (hardware bundle), remove the redundant hasAttr guard since this module is always co-imported with definition.nix within the hardware bundle. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
Replace optionalAttrs config.ghaf.storagevm.enable with lib.mkIf in all consumer modules. The optionalAttrs pattern causes infinite recursion because it eagerly evaluates the condition at the Nix level while constructing config.ghaf, creating a circular dependency. mkIf defers condition evaluation through the NixOS module system, avoiding the cycle. Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Type of Change
Related Issues / Tickets
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify: