mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-19 21:38:07 -04:00
feat(nix): generate module options docs and sync to website
- Add nix/generate-hm-options.nix to export HM and NixOS module options as JSON via nixosOptionsDoc - Expose hm-options-json and nixos-options-json packages in flake.nix - Add CI workflow to auto-build and push JSONs to mangowm.github.io on module changes - Add missing description to hm-modules enable option
This commit is contained in:
parent
129d3da44e
commit
0a687f808d
5 changed files with 97 additions and 0 deletions
28
nix/generate-options.nix
Normal file
28
nix/generate-options.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
self:
|
||||
{
|
||||
pkgs,
|
||||
lib ? pkgs.lib,
|
||||
module,
|
||||
optionPrefix,
|
||||
}:
|
||||
let
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
(import module self)
|
||||
{ _module.check = false; }
|
||||
];
|
||||
specialArgs = { inherit pkgs; };
|
||||
};
|
||||
|
||||
optionsDoc = pkgs.nixosOptionsDoc {
|
||||
options = eval.options;
|
||||
transformOptions =
|
||||
opt:
|
||||
opt
|
||||
// {
|
||||
visible = opt.visible && !opt.internal;
|
||||
name = lib.removePrefix optionPrefix opt.name;
|
||||
};
|
||||
};
|
||||
in
|
||||
optionsDoc.optionsJSON
|
||||
|
|
@ -22,6 +22,7 @@ in
|
|||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable mangowm, a Wayland compositor based on dwl.";
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue