diff --git a/docs/nix/options/flake-module.nix b/docs/nix/options/flake-module.nix index 80b8bb653..20e543b91 100644 --- a/docs/nix/options/flake-module.nix +++ b/docs/nix/options/flake-module.nix @@ -162,6 +162,42 @@ } ]; + baseModule = + # Module + { config, ... }: + { + imports = (import (pkgs.path + "/nixos/modules/module-list.nix")); + nixpkgs.pkgs = pkgs; + clan.core.name = "dummy"; + system.stateVersion = config.system.nixos.release; + # Set this to work around a bug where `clan.core.settings.machine.name` + # is forced due to `networking.interfaces` being forced + # somewhere in the nixpkgs options + facter.detected.dhcp.enable = lib.mkForce false; + }; + + evalClanModules = + let + evaled = lib.evalModules { + class = "nixos"; + modules = [ + baseModule + { + clan.core.settings.directory = self; + } + self.nixosModules.clanCore + ]; + }; + in + evaled; + + coreOptions = + (pkgs.nixosOptionsDoc { + options = (evalClanModules.options).clan.core or { }; + warningsAreErrors = true; + transformOptions = self.clanLib.docs.stripStorePathsFromDeclarations; + }).optionsJSON; + in { # Uncomment for debugging @@ -179,10 +215,16 @@ # scopes = mapAttrsToList mkScope serviceModules; scopes = [ { - name = "Clan"; + name = "Clan (Flake Options)"; modules = docModules; urlPrefix = "https://git.clan.lol/clan/clan-core/src/branch/main/"; } + { + name = "Clan (Machine Options)"; + optionsJSON = "${coreOptions}/share/doc/nixos/options.json"; + urlPrefix = "https://git.clan.lol/clan/clan-core/src/branch/main/"; + + } ]; }; };