feat(docs): Add home-manager module options to the docs
This commit is contained in:
parent
8e27b9ee60
commit
b036df017c
6 changed files with 22 additions and 11 deletions
|
@ -1,17 +1,18 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, markdown }:
|
||||||
let
|
let
|
||||||
eval = lib.evalModules { modules = [ ../nixos/options.nix ]; };
|
eval = lib.evalModules { modules = [ ../nixos/options.nix ]; };
|
||||||
markdown = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
|
nixos-markdown = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit markdown;
|
markdown = nixos-markdown;
|
||||||
docs = pkgs.stdenvNoCC.mkDerivation {
|
docs = pkgs.stdenvNoCC.mkDerivation {
|
||||||
name = "nixos-configuration-book";
|
name = "nixos-configuration-book";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
# copy generated options removing the declared by statement
|
# copy generated options removing the declared by statement
|
||||||
sed '/^\*Declared by:\*$/,/^$/d' <${markdown} >> src/options.md
|
sed '/^\*Declared by:\*$/,/^$/d' <${markdown} >> src/home-options.md
|
||||||
|
sed '/^\*Declared by:\*$/,/^$/d' <${nixos-markdown} >> src/nixos-options.md
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
|
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
# Summary
|
# Summary
|
||||||
|
|
||||||
- [Module Options](./options.md)
|
- [NixOS Module Options](./nixos-options.md)
|
||||||
|
- [Home Manager Module Options](./home-options.md)
|
||||||
|
|
3
docs/src/home-options.md
Normal file
3
docs/src/home-options.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Home Manager Module Options
|
||||||
|
|
||||||
|
Here you will find the home-manager options and their default values (if they have any).
|
3
docs/src/nixos-options.md
Normal file
3
docs/src/nixos-options.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# NixOS Module Options
|
||||||
|
|
||||||
|
Here you will find the NixOS module options and their default values (if they have any).
|
|
@ -1,3 +0,0 @@
|
||||||
# Module Options
|
|
||||||
|
|
||||||
Here you will find the module options and their default values (if they have any).
|
|
12
flake.nix
12
flake.nix
|
@ -29,9 +29,15 @@
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
# Helpers for producing system-specific outputs
|
# Helpers for producing system-specific outputs
|
||||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { pkgs = import nixpkgs { inherit system; }; });
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||||
|
inherit system;
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
});
|
||||||
# Module documentation
|
# Module documentation
|
||||||
doc = forEachSupportedSystem ({ pkgs }: import ./docs { inherit pkgs lib; });
|
doc = forEachSupportedSystem ({ pkgs, system }: import ./docs {
|
||||||
|
inherit (home-config.packages.${system}) markdown;
|
||||||
|
inherit pkgs lib;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Schemas tell Nix about the structure of your flake's outputs
|
# Schemas tell Nix about the structure of your flake's outputs
|
||||||
|
@ -40,7 +46,7 @@
|
||||||
packages = doc;
|
packages = doc;
|
||||||
|
|
||||||
# Nix files formatter (run `nix fmt`)
|
# Nix files formatter (run `nix fmt`)
|
||||||
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixpkgs-fmt);
|
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixpkgs-fmt);
|
||||||
|
|
||||||
nixosModules =
|
nixosModules =
|
||||||
let
|
let
|
||||||
|
|
Loading…
Reference in a new issue