tests: support overriding disko config#480
Draft
Enzime wants to merge 2 commits intonix-community:masterfrom
Draft
tests: support overriding disko config#480Enzime wants to merge 2 commits intonix-community:masterfrom
Enzime wants to merge 2 commits intonix-community:masterfrom
Conversation
Enzime
pushed a commit
to Enzime/disko
that referenced
this pull request
Jan 2, 2026
When extendModules is provided (from module.nix), use it to merge extraSystemConfig with the base configuration BEFORE running prepareDiskoConfig. This allows users to override disko settings (partition sizes, LUKS keys, etc.) via disko.tests.extraConfig using the proper NixOS module system rather than manual attribute merging. The key change is that test-specific disko overrides are now merged before device path transformation, so the overrides are included when prepareDiskoConfig maps devices to QEMU virtio paths. This makes PR nix-community#480 obsolete by using extendModules (enabled by PR nix-community#1094's evalModules support for disko subtypes) instead of lib.recursiveUpdate.
Enzime
pushed a commit
to Enzime/disko
that referenced
this pull request
Jan 2, 2026
When extendModules is provided (from module.nix), use it to merge extraSystemConfig with the base configuration BEFORE running prepareDiskoConfig. This allows users to override disko settings (partition sizes, LUKS keys, etc.) via disko.tests.extraConfig using the proper NixOS module system rather than manual attribute merging. The key change is that test-specific disko overrides are now merged before device path transformation, so the overrides are included when prepareDiskoConfig maps devices to QEMU virtio paths. This makes PR nix-community#480 obsolete by using extendModules (enabled by PR nix-community#1094's evalModules support for disko subtypes) instead of lib.recursiveUpdate.
Enzime
pushed a commit
to Enzime/disko
that referenced
this pull request
Jan 2, 2026
When extendModules is provided (from module.nix), use it to merge extraSystemConfig with the base configuration BEFORE running prepareDiskoConfig. This allows users to override disko settings (partition sizes, LUKS keys, etc.) via disko.tests.extraConfig using the proper NixOS module system rather than manual attribute merging. The key change is that test-specific disko overrides are now merged before device path transformation, so the overrides are included when prepareDiskoConfig maps devices to QEMU virtio paths. This makes PR nix-community#480 obsolete by using extendModules (enabled by PR nix-community#1094's evalModules support for disko subtypes) instead of lib.recursiveUpdate.
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.
The goal of this PR is to add an interface for end users to be able to override the disko config for disko-based tests like
system.build.installTest.I modified some examples to intentionally fail so that we can add test-specific overrides in the same file to show end users examples of overriding the disko config just for tests.
I chose to not make
makeDiskoTestaware ofdisko-config.disko.tests.extraDiskoConfigto simplify the merging logic, however that means callers ofmakeDiskoTestneed to setextraDiskoConfigfromdisko.tests.extraDiskoConfigif they're using standalone files like the tests inside this repo.I'm not really sure if this PR is the right way to implement this as currently it feels like
makeDiskoTestis just a poor man's module system:disko/lib/tests.nix
Lines 44 to 80 in 9ab9637
and as I'm merging values manually, it makes it feel like that even more:
disko/lib/tests.nix
Line 79 in 6b98b81