wrapper-manager-fds/docs: update Nix module options data generation

This commit is contained in:
Gabriel Arazas 2024-07-15 11:35:47 +08:00
parent 1631a81f71
commit 699c547947
3 changed files with 12 additions and 1 deletions

2
docs/.gitignore vendored
View File

@ -1,3 +1,5 @@
# All of the generated assets.
/content/*/nix-module-options/*/content.json
### Hugo ### ### Hugo ###
# Generated files by hugo # Generated files by hugo

View File

@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
patchPhase = '' patchPhase = ''
runHook prePatch runHook prePatch
cp "${optionsDoc.optionsJSON}" > "${finalAttrs.src}/content/" install -Dm0644 "${optionsDoc.optionsJSON}/share/doc/nixos/options.json" "${finalAttrs.src}/content/en-US/nix-module-options/module-environment/content.json"
runHook postPatch runHook postPatch
''; '';

View File

@ -4,7 +4,12 @@ in
{ pkgs ? import sources.nixos-unstable { } }: { pkgs ? import sources.nixos-unstable { } }:
let let
inherit (pkgs) nixosOptionsDoc;
websitePkg = import ./. { inherit pkgs; }; websitePkg = import ./. { inherit pkgs; };
wrapperManagerLib = import ../lib/env.nix;
wrapperManagerEval = wrapperManagerLib.eval { inherit pkgs; };
optionsDoc = nixosOptionsDoc { inherit (wrapperManagerEval) options; };
in in
with pkgs; mkShell { with pkgs; mkShell {
inputsFrom = [ websitePkg ]; inputsFrom = [ websitePkg ];
@ -13,4 +18,8 @@ with pkgs; mkShell {
nodePackages.prettier nodePackages.prettier
vscode-langservers-extracted vscode-langservers-extracted
]; ];
shellHook = ''
install -Dm0644 ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./content/en-US/nix-module-options/module-environment/content.json
'';
} }