Skip to content

Commit d95b08c

Browse files
committed
fix: add appropriate defaultText entries to options
Avoids issues with docs generation when referring to config from within an option's `default`.
1 parent 60f8b8f commit d95b08c

File tree

8 files changed

+9
-0
lines changed

8 files changed

+9
-0
lines changed

modules/nixos/bluetooth.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
lib.mkEnableOption "Enable the Facter bluetooth module"
55
// {
66
default = builtins.length (config.facter.report.hardware.bluetooth or [ ]) > 0;
7+
defaultText = "hardware dependent";
78
};
89

910
config.hardware.bluetooth.enable = lib.mkIf config.facter.detected.bluetooth.enable (

modules/nixos/disk.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ in
1616
++ (report.hardware.storage_controller or [ ])
1717
)
1818
);
19+
defaultText = "hardware dependent";
1920
description = ''
2021
List of kernel modules that are needed to access the disk.
2122
'';

modules/nixos/facter.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
{ }
2626
else
2727
builtins.fromJSON (builtins.readFile config.facter.reportPath);
28+
defaultText = "A JSON import from config.facter.reportPath (if not null), {} otherwise.";
2829
description = "An import for the reportPath.";
2930
};
3031

modules/nixos/graphics/amd.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ in
99
default = builtins.elem "amdgpu" (
1010
facterLib.collectDrivers (config.facter.report.hardware.graphics_card or [ ])
1111
);
12+
defaultText = "hardware dependent";
1213
};
1314
};
1415
config = lib.mkIf cfg.enable {

modules/nixos/graphics/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ in
1010
options.facter.detected = {
1111
graphics.enable = lib.mkEnableOption "Enable the Graphics module" // {
1212
default = builtins.length (config.facter.report.hardware.monitor or [ ]) > 0;
13+
defaultText = "hardware dependent";
1314
};
1415
boot.graphics.kernelModules = lib.mkOption {
1516
type = lib.types.listOf lib.types.str;
@@ -18,6 +19,7 @@ in
1819
default = lib.remove "nouveau" (
1920
facterLib.stringSet (facterLib.collectDrivers (config.facter.report.hardware.graphics_card or [ ]))
2021
);
22+
defaultText = "hardware dependent";
2123
description = ''
2224
List of kernel modules to load at boot for the graphics card.
2325
'';

modules/nixos/keyboard.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ in
88
options.facter.detected.boot.keyboard.kernelModules = lib.mkOption {
99
type = lib.types.listOf lib.types.str;
1010
default = facterLib.stringSet (facterLib.collectDrivers (report.hardware.usb_controller or [ ]));
11+
defaultText = "hardware dependent";
1112
example = [ "usbhid" ];
1213
description = ''
1314
List of kernel modules to include in the initrd to support the keyboard.

modules/nixos/networking/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
options.facter.detected.dhcp.enable = lib.mkEnableOption "Facter dhcp module" // {
1010
default = builtins.length config.facter.report.hardware.network_interface or [ ] > 0;
11+
defaultText = "hardware dependent";
1112
};
1213
config = lib.mkIf config.facter.detected.dhcp.enable {
1314
networking.useDHCP = lib.mkDefault true;

modules/nixos/networking/initrd.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ in
1010
default = facterLib.stringSet (
1111
facterLib.collectDrivers (report.hardware.network_controller or [ ])
1212
);
13+
defaultText = "hardware dependent";
1314
description = ''
1415
List of kernel modules to include in the initrd to support networking.
1516
'';

0 commit comments

Comments
 (0)