generated docs with another tool

This commit is contained in:
2025-10-16 14:39:49 +02:00
parent 0fc42de009
commit 400be5d4a4
4 changed files with 182 additions and 433 deletions

View File

@@ -20,8 +20,27 @@
) )
]; ];
}; };
replaceNixPathWithRelative =
p:
let
match = builtins.match "^/nix/store/[^/]+/(.*)$" p;
in
if match != null then
"https://gitlab.com/quirinecker/dotfiles-modules/" + builtins.elemAt match 0
else
p;
transformOptions =
o:
let
declarations = o.declarations;
mappedDeclarations = builtins.map (d: replaceNixPathWithRelative d) declarations;
in
o // { declarations = mappedDeclarations; };
in in
pkgs.nixosOptionsDoc { pkgs.nixosOptionsDoc {
inherit (eval) options; options = eval.options;
transformOptions = o: transformOptions o;
}; };
} }

View File

@@ -1,494 +1,171 @@
## _module\.args # NixOS Module Options
Additional arguments passed to each module in addition to ones
like ` lib `, ` config `,
and ` pkgs `, ` modulesPath `\.
This option is also available to all submodules\. Submodules do not ## [`options.modules.walker.enable`](walker.nix#L9)
inherit args from their parent module, nor do they provide args to
their parent module or sibling submodules\. The sole exception to
this is the argument ` name ` which is provided by
parent modules to a submodule and contains the attribute name
the submodule is bound to, or a unique generated name if it is
not bound to an attribute\.
Some arguments are already passed by default, of which the walker
following *cannot* be changed with this option:
- ` lib `: The nixpkgs library\. **Type:** `boolean`
- ` config `: The results of all options after merging the values from all modules together\. **Default:** `false`
- ` options `: The options declared in all modules\. **Example:** `true`
- ` specialArgs `: The ` specialArgs ` argument passed to ` evalModules `\. ## [`options.modules.fish.enable`](fish.nix#L12)
- All attributes of ` specialArgs ` fish
Whereas option values can generally depend on other option values **Type:** `boolean`
thanks to laziness, this does not apply to ` imports `, which
must be computed statically before anything else\.
For this reason, callers of the module system can provide ` specialArgs ` **Default:** `false`
which are available during import resolution\.
For NixOS, ` specialArgs ` includes **Example:** `true`
` modulesPath `, which allows you to import
extra modules from the nixpkgs package tree without having to
somehow make the module aware of the location of the
` nixpkgs ` or NixOS directories\.
``` ## [`options.modules.hyprpanel.enable`](hyprpanel.nix#L8)
{ modulesPath, ... }: {
imports = [
(modulesPath + "/profiles/minimal.nix")
];
}
```
For NixOS, the default value for this option includes at least this argument: hyprpanel
- ` pkgs `: The nixpkgs package set according to **Type:** `boolean`
the ` nixpkgs.pkgs ` option\.
**Default:** `false`
**Example:** `true`
*Type:* ## [`options.modules.hyprpanel.avatar.image`](hyprpanel.nix#L9)
lazy attribute set of raw value
*Declared by:*
- [\<nixpkgs/lib/modules\.nix>](https://github.com/NixOS/nixpkgs/blob//lib/modules.nix)
## modules\.default_apps\.enable
Whether to enable default_apps\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/default_apps\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/default_apps.nix)
## modules\.editorconfig\.enable
Whether to enable enables editorconfig\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/editorconfig\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/editorconfig.nix)
## modules\.fish\.enable
Whether to enable fish\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/fish\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/fish.nix)
## modules\.hyprland\.enable
Whether to enable hyprland\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprland\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprland.nix)
## modules\.hyprpanel\.enable
Whether to enable hyprpanel\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel.nix)
## modules\.hyprpanel\.avatar\.image
avatar image avatar image
**Type:** `lib.types.path`
**Default:** `""`
*Type:* ## [`options.modules.hyprpanel.avatar.name`](hyprpanel.nix#L15)
absolute path
*Default:*
` "" `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel.nix)
## modules\.hyprpanel\.avatar\.name
Username to be displayed Username to be displayed
**Type:** `lib.types.str`
**Default:** `"John Doe"`
*Type:* ## [`options.modules.theme.enable`](theme.nix#L9)
string
theme
**Type:** `boolean`
*Default:* **Default:** `false`
` "John Doe" `
*Declared by:* **Example:** `true`
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel.nix)
## [`options.modules.default_apps.enable`](default_apps.nix#L11)
default_apps
## modules\.neovim\.enable **Type:** `boolean`
**Default:** `false`
**Example:** `true`
Whether to enable neovim\. ## [`options.modules.editorconfig.enable`](editorconfig.nix#L4)
enables editorconfig
**Type:** `boolean`
*Type:* **Default:** `false`
boolean
**Example:** `true`
## [`options.modules.utilities.enable`](utilities.nix#L9)
*Default:* utilities
` false `
**Type:** `boolean`
**Default:** `false`
*Example:* **Example:** `true`
` true `
*Declared by:* ## [`options.modules.terminalEmulators.kitty.enable`](terminal_emulators/kitty.nix#L4)
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/neovim\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/neovim.nix)
kitty
**Type:** `boolean`
## modules\.nushell\.enable **Default:** `false`
**Example:** `true`
## [`options.modules.terminalEmulators.ghostty.enable`](terminal_emulators/ghostty.nix#L12)
Whether to enable nushell\. ghostty
**Type:** `boolean`
**Default:** `false`
*Type:* **Example:** `true`
boolean
## [`options.modules.terminalEmulators.wezterm.enable`](terminal_emulators/wezterm.nix#L7)
kitty
*Default:* **Type:** `boolean`
` false `
**Default:** `false`
**Example:** `true`
*Example:* ## [`options.modules.nushell.enable`](nushell.nix#L8)
` true `
*Declared by:* nushell
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/nushell\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/nushell.nix)
**Type:** `boolean`
**Default:** `false`
## modules\.starship\.enable **Example:** `true`
## [`options.modules.neovim.enable`](neovim.nix#L22)
neovim
Whether to enable enables starship\. **Type:** `boolean`
**Default:** `false`
**Example:** `true`
*Type:* ## [`options.modules.hyprland.enable`](hyprland.nix#L12)
boolean
hyprland
**Type:** `boolean`
*Default:* **Default:** `false`
` false `
**Example:** `true`
## [`options.modules.tmux.enable`](tmux.nix#L12)
*Example:* tmux
` true `
*Declared by:* **Type:** `boolean`
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/starship\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/starship.nix)
**Default:** `false`
**Example:** `true`
## modules\.terminalEmulators\.ghostty\.enable ## [`options.modules.starship.enable`](starship.nix#L16)
enables starship
**Type:** `boolean`
Whether to enable ghostty\. **Default:** `false`
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/ghostty\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/ghostty.nix)
## modules\.terminalEmulators\.kitty\.enable
Whether to enable kitty\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/kitty\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/kitty.nix)
## modules\.terminalEmulators\.wezterm\.enable
Whether to enable kitty\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/wezterm\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/terminal_emulators/wezterm.nix)
## modules\.theme\.enable
Whether to enable theme\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/theme\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/theme.nix)
## modules\.tmux\.enable
Whether to enable tmux\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/tmux\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/tmux.nix)
## modules\.utilities\.enable
Whether to enable utilities\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/utilities\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/utilities.nix)
## modules\.walker\.enable
Whether to enable walker\.
*Type:*
boolean
*Default:*
` false `
*Example:*
` true `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/walker\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/walker.nix)
**Example:** `true`
---
*Generated with [nix-options-doc](https://github.com/Thunderbottom/nix-options-doc)*

86
flake.lock generated
View File

@@ -25,27 +25,25 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": { "flake-utils": {
"inputs": { "inputs": {
"nixpkgs": [ "systems": "systems"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1760462439, "lastModified": 1731533236,
"narHash": "sha256-bks3rTsKGlqehk4l7rViIg2lBnUsY6we22O+ecRZB/c=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "nix-community", "owner": "numtide",
"repo": "home-manager", "repo": "flake-utils",
"rev": "990e5ce6791ff1f497a61280a82eb66e3789e0e9", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "numtide",
"repo": "home-manager", "repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
"home-manager_2": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"zen-browser", "zen-browser",
@@ -66,6 +64,28 @@
"type": "github" "type": "github"
} }
}, },
"nix-options-doc": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1742115705,
"narHash": "sha256-RfXwJPWBoWswIU68+y/XZfTWtFHd/fK14bKvOlRmfPo=",
"owner": "Thunderbottom",
"repo": "nix-options-doc",
"rev": "2caa4b5756a8666d65d70122f413e295f56886e7",
"type": "github"
},
"original": {
"owner": "Thunderbottom",
"repo": "nix-options-doc",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1760284886, "lastModified": 1760284886,
@@ -84,13 +104,49 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "nix-options-doc": "nix-options-doc",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"walker": "walker", "walker": "walker",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }
}, },
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nix-options-doc",
"nixpkgs"
]
},
"locked": {
"lastModified": 1740796337,
"narHash": "sha256-FuoXrXZPoJEZQ3PF7t85tEpfBVID9JQIOnVKMNfTAb0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "bbac9527bc6b28b6330b13043d0e76eac11720dc",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": { "systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -111,7 +167,7 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1760434150, "lastModified": 1760434150,
@@ -129,7 +185,7 @@
}, },
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"home-manager": "home-manager_2", "home-manager": "home-manager",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]

View File

@@ -16,11 +16,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { nix-options-doc = {
url = "github:nix-community/home-manager"; url = "github:Thunderbottom/nix-options-doc";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = outputs =
@@ -53,18 +52,16 @@
inputs.walker.homeManagerModules.default inputs.walker.homeManagerModules.default
inputs.zen-browser.homeModules.beta inputs.zen-browser.homeModules.beta
]; ];
docsUtil = import ./docs.nix;
docs = docsUtil.buildDocs {
inherit pkgs inputs modules;
};
in in
{ {
homeManager = { homeManager = {
imports = modules ++ externalModules; imports = modules ++ externalModules;
}; };
docs = docs.optionsCommonMark; docs = pkgs.runCommand "docs" { } ''
${
inputs.nix-options-doc.outputs.packages."${system}".default
}/bin/nix-options-doc --path ${./homemanager} --out $out
'';
}; };
} }