-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos: Fix eval error for documentation.nixos
Introduced by 0f3b89b. If services.nixosManual.showManual is enabled and documentation.nixos.enable is not, there is no config.system.build.manual available, so evaluation fails. For example this is the case for the installer tests. There is however an assertion which should catch exactly this, but it isn't thrown because the usage of config.system.build.manual is evaluated earlier than the assertions. So I split the assertion off into a separate mkIf to make sure it is shown appropriately and also fixed the installation-device profile to enable documentation.nixos. Signed-off-by: aszlig <aszlig@nix.build> Cc: @oxij
- Loading branch information
Showing
2 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
c5bb431
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.
c5bb431
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.
c5bb431
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.
@oxij: Fair enough, that seems to be a better fix, I'll do a partial revert + merge after reviewing #47293.
c5bb431
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.
@oxij: Okay, merged the pull request in 9bfd864, however as noted there, I don't think that just reordering asserts/warnings is the proper fix, because in any case even when not building the full system, the eval error stays there when you don't access
config.system.build
but some otherconfig
value, like how it's done innixos-option
.c5bb431
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.
For example, when changing the warnings in the systemd module to asserts, you'll get the same evaluation error but this time the other way around. Swapping the evaluation order for every corner case like this clearly is something I'd consider a workaround. And yes, I acknowledge that
mkMerge
here makes the code a bit more convoluted, but also prevents a minefield of random evaluation errors whenever the implementation of another module changes in the way described.c5bb431
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.
So in summary: While I do find some advantages in ordering assertions before warnings (as stated in the mentioned merge commit), I'm not going to revert this until there is a proper fix rather than just shuffling around evaluation order.
c5bb431
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.
c5bb431
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 problem here is that
nixos-manual.nix
now requires that you only evaluate viaconfig.system.build
and any other way will potentially trigger an evaluation error, for example (eg. when on 563d5b1):... and really anything that triggers unboxing
config.systemd.services.nixos-manual
.It is not, because it defaults to
false
for the tests:nixpkgs/nixos/lib/build-vms.nix
Line 31 in e0f4610
While setting it to
true
in theinstallation-device
profile is a no-op for eg. building an ISO image it doesn't hurt to set it tofalse
here instead of adding another special case in saytest-instrumentation.nix
and giving a comment referring toinstallation-device.nix
.c5bb431
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.