nixos-option: show option value more conservatively

Use safeToPretty helper for showing the option value also in the non-
recursive case.  This avoids fully erroring out when e.g. a suboption
lacks a defined value and we try to (recursively) pretty-print it.
This commit is contained in:
FireFly
2026-09-26 01:01:48 +02:00
parent 4975466d32
commit e31070ee43

View File

@@ -125,7 +125,7 @@ let
in
lib.concatStringsSep "\n\n" (
lib.concatLists [
(entry true "Value" (toPretty value))
(entry true "Value" (safeToPretty value))
(entry (option ? default) "Default" (toPretty option.default))
(entry (option ? type) "Type" (option.type.description))
(entry (option ? description) "Description" (lib.removeSuffix "\n" option.description))