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
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
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\.
## [`options.modules.walker.enable`](walker.nix#L9)
Some arguments are already passed by default, of which the
following *cannot* be changed with this option:
walker
- ` 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 `
Whereas option values can generally depend on other option values
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 `
which are available during import resolution\.
For NixOS, ` specialArgs ` includes
` 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\.
```
{ modulesPath, ... }: {
imports = [
(modulesPath + "/profiles/minimal.nix")
];
}
```
fish
For NixOS, the default value for this option includes at least this argument:
**Type:** `boolean`
- ` pkgs `: The nixpkgs package set according to
the ` nixpkgs.pkgs ` option\.
**Default:** `false`
**Example:** `true`
## [`options.modules.hyprpanel.enable`](hyprpanel.nix#L8)
*Type:*
lazy attribute set of raw value
hyprpanel
*Declared by:*
- [\<nixpkgs/lib/modules\.nix>](https://github.com/NixOS/nixpkgs/blob//lib/modules.nix)
**Type:** `boolean`
**Default:** `false`
**Example:** `true`
## 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
## [`options.modules.hyprpanel.avatar.image`](hyprpanel.nix#L9)
avatar image
**Type:** `lib.types.path`
**Default:** `""`
*Type:*
absolute path
*Default:*
` "" `
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel.nix)
## modules\.hyprpanel\.avatar\.name
## [`options.modules.hyprpanel.avatar.name`](hyprpanel.nix#L15)
Username to be displayed
**Type:** `lib.types.str`
**Default:** `"John Doe"`
*Type:*
string
## [`options.modules.theme.enable`](theme.nix#L9)
theme
**Type:** `boolean`
*Default:*
` "John Doe" `
**Default:** `false`
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/hyprpanel.nix)
**Example:** `true`
## [`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:*
boolean
**Default:** `false`
**Example:** `true`
## [`options.modules.utilities.enable`](utilities.nix#L9)
*Default:*
` false `
utilities
**Type:** `boolean`
**Default:** `false`
*Example:*
` true `
**Example:** `true`
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/neovim\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/neovim.nix)
## [`options.modules.terminalEmulators.kitty.enable`](terminal_emulators/kitty.nix#L4)
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:*
boolean
**Example:** `true`
## [`options.modules.terminalEmulators.wezterm.enable`](terminal_emulators/wezterm.nix#L7)
kitty
*Default:*
` false `
**Type:** `boolean`
**Default:** `false`
**Example:** `true`
*Example:*
` true `
## [`options.modules.nushell.enable`](nushell.nix#L8)
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/nushell\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/nushell.nix)
nushell
**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:*
boolean
## [`options.modules.hyprland.enable`](hyprland.nix#L12)
hyprland
**Type:** `boolean`
*Default:*
` false `
**Default:** `false`
**Example:** `true`
## [`options.modules.tmux.enable`](tmux.nix#L12)
*Example:*
` true `
tmux
*Declared by:*
- [/nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/starship\.nix](file:///nix/store/a661xl77ba24lv1j80jyijjvk1h6h1vz-source/homemanager/starship.nix)
**Type:** `boolean`
**Default:** `false`
**Example:** `true`
## modules\.terminalEmulators\.ghostty\.enable
## [`options.modules.starship.enable`](starship.nix#L16)
enables starship
**Type:** `boolean`
Whether to enable ghostty\.
*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)
**Default:** `false`
**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"
}
},
"home-manager": {
"flake-utils": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
"systems": "systems"
},
"locked": {
"lastModified": 1760462439,
"narHash": "sha256-bks3rTsKGlqehk4l7rViIg2lBnUsY6we22O+ecRZB/c=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "990e5ce6791ff1f497a61280a82eb66e3789e0e9",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager_2": {
"home-manager": {
"inputs": {
"nixpkgs": [
"zen-browser",
@@ -66,6 +64,28 @@
"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": {
"locked": {
"lastModified": 1760284886,
@@ -84,13 +104,49 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-options-doc": "nix-options-doc",
"nixpkgs": "nixpkgs",
"walker": "walker",
"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": {
"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": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -111,7 +167,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
"systems": "systems_2"
},
"locked": {
"lastModified": 1760434150,
@@ -129,7 +185,7 @@
},
"zen-browser": {
"inputs": {
"home-manager": "home-manager_2",
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
]

View File

@@ -16,11 +16,10 @@
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
nix-options-doc = {
url = "github:Thunderbottom/nix-options-doc";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -53,18 +52,16 @@
inputs.walker.homeManagerModules.default
inputs.zen-browser.homeModules.beta
];
docsUtil = import ./docs.nix;
docs = docsUtil.buildDocs {
inherit pkgs inputs modules;
};
in
{
homeManager = {
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
'';
};
}