From 16d23d9b96374de0f32d421c45c35ca9a7ffd0a6 Mon Sep 17 00:00:00 2001 From: Scott Edlund Date: Sun, 8 Feb 2026 15:53:35 +0800 Subject: [PATCH] feat(options-doc): test doc generation for module --- checks/options-doc.nix | 21 +++++++++++++++++++++ flake.nix | 1 + 2 files changed, 22 insertions(+) create mode 100644 checks/options-doc.nix diff --git a/checks/options-doc.nix b/checks/options-doc.nix new file mode 100644 index 0000000..a15f128 --- /dev/null +++ b/checks/options-doc.nix @@ -0,0 +1,21 @@ +{ system +, inputs +, ... +}: + +let + eval = inputs.nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + inputs.self.nixosModules.wsl + { + # This forces evaluation of all types/descriptions in all modules + documentation.nixos.includeAllModules = true; + } + ]; + }; +in +# Return the options JSON derivation. + # If any option type has a circular reference or missing attribute, + # evaluation will fail here. +eval.config.system.build.manual.optionsJSON diff --git a/flake.nix b/flake.nix index 06d7dd0..a48a081 100644 --- a/flake.nix +++ b/flake.nix @@ -77,6 +77,7 @@ { nixpkgs-fmt = pkgs.callPackage ./checks/nixpkgs-fmt.nix args; nixpkgs-input = pkgs.callPackage ./checks/nixpkgs-input.nix args; + options-doc = pkgs.callPackage ./checks/options-doc.nix args; rustfmt = pkgs.callPackage ./checks/rustfmt.nix args; side-effects = pkgs.callPackage ./checks/side-effects.nix args; username = pkgs.callPackage ./checks/username.nix args;