]*))/gi ,'<https$1');
-- text = text.replace(/\[\]\(#opt-(\s*([^)]*))/gi ,'$1').replace(/\)/gi,'');
-- //[](#opt-wayland.windowManager.hyprland.plugins)
-- text = text.replace(/\{var\}(\s*([^\n]*))/gi ,'$1').replace(/`/gi,'')
-- text = text.replace(/:::\ \{\.note\}(\s*([^:::]*))/gi ,'$1
').replace(/:::/,'').replace(/\n/g, '
')
-- return text;
--}
--
- var expandOptionMD = function(el){
-
- modalTitle.innerHTML = currentSet[el].title;
-
-- let dhtml = parseMD(currentSet[el].doc);
-- var elDesc = "Description
" + dhtml + "
";
-+ var elDesc = "Description
" + currentSet[el].doc + "
";
- var elArgs = "Args
" + currentSet[el].args.join(', ') + "
";
- // var elNote = ( currentSet[el].note == "" ? "": "Note
" + currentSet[el].note + "
");
- // var elDefault = "Default
" + currentSet[el].default + "
";
-@@ -290,7 +188,7 @@ var expandOption = function(el){
-
- //console.log(currentSet[el].description.replace(/:::\ \{\.note\}(\s*([^:::]*))/gi ,'$1
').replace(/:::/,''));
-
-- var elDesc = "Description
" + parseDescription(currentSet[el].description) + "
";
-+ var elDesc = "Description
" + currentSet[el].description + "
";
- var elType = "Type
" + currentSet[el].type + "
";
- //var elNote = ( currentSet[el].note == "" ? "": "Note
" + currentSet[el].note + "
");
- var elDefault = ( currentSet[el].default == "" ? "" : "Default
" + currentSet[el].default + "
");
---
-2.47.0
-
diff --git a/modules/nixos/extranix/0002-chore-remove-useless-dependencies.patch b/modules/nixos/extranix/0002-chore-remove-useless-dependencies.patch
deleted file mode 100644
index 9d391f2..0000000
--- a/modules/nixos/extranix/0002-chore-remove-useless-dependencies.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 957189be0a61f954a1bcfb204f982f59ae6435ea Mon Sep 17 00:00:00 2001
-From: catvayor
-Date: Thu, 12 Dec 2024 17:04:45 +0100
-Subject: [PATCH 2/2] chore: remove useless dependencies
-
----
- layouts/index.html | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/layouts/index.html b/layouts/index.html
-index 63a6158..780ea78 100644
---- a/layouts/index.html
-+++ b/layouts/index.html
-@@ -17,7 +17,6 @@
-
-
-
--
-
-
-
---
-2.47.0
-
diff --git a/modules/nixos/extranix/0003-feat-separate-HTML-description-of-MD-description.patch b/modules/nixos/extranix/0003-feat-separate-HTML-description-of-MD-description.patch
deleted file mode 100644
index cb8149f..0000000
--- a/modules/nixos/extranix/0003-feat-separate-HTML-description-of-MD-description.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From b0f6c845280bee20bcc28a136436e000bde8a457 Mon Sep 17 00:00:00 2001
-From: catvayor
-Date: Mon, 16 Dec 2024 11:25:38 +0100
-Subject: [PATCH] feat: separate HTML description of MD description
-
----
- static/js/script.js | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/static/js/script.js b/static/js/script.js
-index d3ec223..5d9fc6e 100644
---- a/static/js/script.js
-+++ b/static/js/script.js
-@@ -188,7 +188,7 @@ var expandOption = function(el){
-
- //console.log(currentSet[el].description.replace(/:::\ \{\.note\}(\s*([^:::]*))/gi ,'$1
').replace(/:::/,''));
-
-- var elDesc = "Description
" + currentSet[el].description + "
";
-+ var elDesc = "Description
" + currentSet[el].descriptionHTML + "
";
- var elType = "Type
" + currentSet[el].type + "
";
- //var elNote = ( currentSet[el].note == "" ? "": "Note
" + currentSet[el].note + "
");
- var elDefault = ( currentSet[el].default == "" ? "" : "Default
" + currentSet[el].default + "
");
---
-2.47.0
-
diff --git a/modules/nixos/extranix/0004-fix-indentation-of-ul.patch b/modules/nixos/extranix/0004-fix-indentation-of-ul.patch
deleted file mode 100644
index cabfc09..0000000
--- a/modules/nixos/extranix/0004-fix-indentation-of-ul.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From e31e0330b9b012b6e09f8eb6bc670e4336d1aedc Mon Sep 17 00:00:00 2001
-From: catvayor
-Date: Mon, 16 Dec 2024 12:53:27 +0100
-Subject: [PATCH] fix: indentation of
-
----
- static/css/nucleus.css | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/static/css/nucleus.css b/static/css/nucleus.css
-index a4674a8..9ada521 100644
---- a/static/css/nucleus.css
-+++ b/static/css/nucleus.css
-@@ -533,7 +533,8 @@ p {
-
- ul, ol {
- margin-top: 1.7rem;
-- margin-bottom: 1.7rem; }
-+ margin-bottom: 1.7rem;
-+ margin-left: 1rem; }
- ul ul, ul ol, ol ul, ol ol {
- margin-top: 0;
- margin-bottom: 0; }
---
-2.47.0
-
diff --git a/modules/nixos/extranix/0005-feat-match-all-substring-by-default.patch b/modules/nixos/extranix/0005-feat-match-all-substring-by-default.patch
deleted file mode 100644
index 17bbac8..0000000
--- a/modules/nixos/extranix/0005-feat-match-all-substring-by-default.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 206ce2744cdaa166ee482fba90a879f2688b234a Mon Sep 17 00:00:00 2001
-From: catvayor
-Date: Sat, 21 Dec 2024 10:14:46 +0100
-Subject: [PATCH] feat: match all substring by default
-
----
- layouts/index.html | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/layouts/index.html b/layouts/index.html
-index 780ea78..c50ada4 100644
---- a/layouts/index.html
-+++ b/layouts/index.html
-@@ -109,9 +109,9 @@
- - Strategy
- -
-
-
-
---
-2.47.0
-
diff --git a/modules/nixos/extranix/default.nix b/modules/nixos/extranix/default.nix
index 4618f31..fd3cdba 100644
--- a/modules/nixos/extranix/default.nix
+++ b/modules/nixos/extranix/default.nix
@@ -1,4 +1,5 @@
# SPDX-FileCopyrightText: 2024 Lubin Bailly
+# SPDX-FileCopyrightText: 2025 Tom Hubrecht
#
# SPDX-License-Identifier: EUPL-1.2
@@ -8,201 +9,305 @@
pkgs,
...
}:
+
let
inherit (lib)
attrNames
- concatMapStringsSep
concatStringsSep
escapeXML
+ evalModules
filter
- getExe
+ flip
+ getAttr
hasPrefix
- hasSuffix
head
- importJSON
- mapAttrs'
+ listToAttrs
mapAttrsToList
- mkDefault
+ literalExpression
mkEnableOption
mkIf
mkOption
+ nameValuePair
+ optionAttrSetToDocList
optionalString
pathIsDirectory
+ pipe
+ removeAttrs
removePrefix
+ removeSuffix
;
+
inherit (lib.strings)
sanitizeDerivationName
;
+
inherit (lib.types)
attrs
attrsOf
deferredModule
listOf
+ nullOr
path
submodule
str
;
- yaml = pkgs.formats.yaml { };
- json = pkgs.formats.json { };
- cfg = config.services.extranix;
- module-eval =
- module-name: module:
+ inherit (pkgs)
+ fetchFromGitea
+ hugo
+ runCommand
+ symlinkJoin
+ ;
+
+ mkDocJSON =
+ module:
+ {
+ ignored-modules,
+ path-translations,
+ paths,
+ specialArgs,
+ ...
+ }:
let
- ignored-eval = lib.evalModules {
- modules = module.ignored-modules;
- inherit (module) specialArgs;
- };
- ignored-opts-doc = pkgs.nixosOptionsDoc { inherit (ignored-eval) options; };
- ignored-opts = importJSON "${ignored-opts-doc.optionsJSON}/share/doc/nixos/options.json";
- eval = lib.evalModules {
- modules = module.paths ++ module.ignored-modules;
- inherit (module) specialArgs;
- };
- opts-doc = pkgs.nixosOptionsDoc { inherit (eval) options; };
- opts = importJSON "${opts-doc.optionsJSON}/share/doc/nixos/options.json";
- filtered-opts = removeAttrs opts (attrNames ignored-opts);
- path-translation =
- let
- translations = map (
- { base, url }:
- {
- url = "${url}${optionalString (!hasSuffix "/" url) "/"}";
- base =
- let
- base1 = toString base;
- in
- base1 + (optionalString (!hasSuffix "/" base1) "/");
- }
- ) module.path-translations;
- in
+ # NOTE: A big simplification of nixpkgs' make-options-doc
+ # It turns out that we only need the json output, and have
+ # no `baseOptionsJSON`, so the transformation done is `id`
+ mkOpts = (flip pipe) [
+ # Evaluate the modules
+ (modules: evalModules { inherit modules specialArgs; })
+ # Extract the options
+ (getAttr "options")
+ # Transform into a list of options
+ optionAttrSetToDocList
+ # Remove invisible and internal options
+ (filter (o: o.visible && !o.internal))
+ # Remove extraneous attributes
+ (builtins.map (
+ o:
+ nameValuePair o.name (
+ removeAttrs o [
+ "name"
+ "visible"
+ "internal"
+ ]
+ )
+ ))
+ # Transform back to an attribute set
+ listToAttrs
+ ];
+
+ # INFO: Subtract options of the ignored modules from
+ # the complete set of options
+ ignored = attrNames (mkOpts ignored-modules);
+ options = removeAttrs (mkOpts (paths ++ ignored-modules)) ignored;
+
+ directories = builtins.map (getAttr "base") path-translations;
+
+ mkTranslation =
path:
let
- fullPath = path + (optionalString (pathIsDirectory path) "/default.nix");
- fitting = filter ({ base, ... }: hasPrefix base fullPath) translations;
- translate-info = head (
- fitting
- ++ [
- (throw (
- "${fullPath} is not in any base path of ${module-name}. Base paths are "
- + concatMapStringsSep "\n" ({ base, ... }: base) translations
- ))
- ]
- );
- innerPath = removePrefix translate-info.base fullPath;
+ # Get the file associated to the module
+ file = if pathIsDirectory path then path + "/default.nix" else path;
+
+ # Get the parent module set
+ matching = filter (m: hasPrefix m.base path) path-translations;
+ parent = head matching;
+ filePath = removePrefix parent.base file;
in
- {
- name = "<${innerPath}>";
- url = "${translate-info.url}${innerPath}";
- };
- result' = json.generate "options-extranix-fileDesc.json" {
- last_update = "-/-";
- options = mapAttrsToList (title: val: {
- inherit title;
- inherit (val)
- type
- readOnly
- loc
- ;
- descriptionHTML = pkgs.runCommand "option-${title}.html" { } ''
- ${getExe pkgs.pandoc} -f markdown-raw_html ${pkgs.writeText "option-${title}.md" val.description} > $out
- '';
- description = escapeXML val.description;
- example = escapeXML (val.example.text or "");
- default = escapeXML (val.default.text or "");
- declarations = map path-translation val.declarations;
- }) filtered-opts;
- };
- result =
- pkgs.runCommand "options-extranix.json"
+ if matching == [ ] then
+ (throw "${file} is not a descendant of ${module}. Declared parents are: \n ${concatStringsSep "\n " directories}")
+ else
{
- nativeBuildInputs = [ pkgs.jq ];
- }
- ''
- jq -r '.options[].descriptionHTML | "--rawfile\n" + . + "\n" + .' ${result'} | xargs \
- jq -c '.options |= map(.descriptionHTML as $desc | .descriptionHTML |= $ARGS.named.[$desc])' ${result'} \
- > $out
- '';
+ name = "<${filePath}>";
+ url = "${parent.url}/${filePath}";
+ };
in
- result;
+ pkgs.runCommand "options-extranix"
+ {
+ fileName = sanitizeDerivationName "options-${module}.json";
+ nativeBuildInputs = [ pkgs.jq ];
- options-files = mapAttrs' (name: value: {
- name = sanitizeDerivationName name;
- value = module-eval name value;
- }) cfg.modules;
+ passAsFile = [ "result" ];
+ result = builtins.toJSON {
+ last_update = "-/-";
+ options = mapAttrsToList (
+ title:
+ {
+ default ? {
+ text = "";
+ },
+ description,
+ example ? {
+ text = "";
+ },
+ loc,
+ readOnly,
+ type,
+ declarations,
+ ...
+ }:
+ {
+ inherit
+ loc
+ readOnly
+ title
+ type
+ ;
- webroot = pkgs.callPackage ./webroot.nix {
- inherit options-files;
- inherit (cfg) static-data;
- settings = yaml.generate "config.yaml" cfg.settings;
- hugo-theme-extranix-options-search = pkgs.callPackage ./hugo-theme-extranix-options-search.nix { };
- };
+ descriptionHTML = pkgs.runCommandLocal "option-${title}.html" {
+ inherit description;
+ passAsFile = [ "description" ];
+
+ nativeBuildInputs = [ pkgs.pandoc ];
+ } "pandoc -f markdown-raw_html $descriptionPath > $out";
+
+ description = escapeXML description;
+ example = escapeXML example.text;
+ default = escapeXML default.text;
+ declarations = builtins.map mkTranslation declarations;
+ }
+ ) options;
+ };
+ }
+ ''
+ mkdir -p $out
+ jq -r '.options[].descriptionHTML | "--rawfile\n" + . + "\n" + .' $resultPath | xargs \
+ jq -c '.options |= map(.descriptionHTML as $desc | .descriptionHTML |= $ARGS.named.[$desc])' $resultPath \
+ > $out/$fileName
+ '';
+
+ website =
+ runCommand "search-infra"
+ {
+ theme = fetchFromGitea {
+ domain = "git.dgnum.eu";
+ owner = "DGNum";
+ repo = "options-search-theme";
+ rev = "bcdc3e724ad5478ed39ce62a6e3342130a1bcabd";
+ hash = "sha256-pg0NifmHdfK4OltSOQfYgTVa7juZlGF642Q4Du3uheY=";
+ };
+
+ nativeBuildInputs = [ hugo ];
+
+ config = builtins.toJSON cfg.settings;
+ passAsFile = [ "config" ];
+
+ data = symlinkJoin {
+ name = "options-data";
+ paths = mapAttrsToList mkDocJSON cfg.modules;
+ };
+ }
+ ''
+ # Setup the directory structure
+ mkdir themes && ln -s $theme themes/options-search
+ ln -s $configPath hugo.json
+ mkdir static
+ ${optionalString (cfg.static != null) "cp -R ${cfg.static} static"}
+ ln -s $data static/data
+
+ # Build the website
+ hugo -d $out
+ '';
+
+ cfg = config.services.extranix;
in
+
{
options.services.extranix = {
enable = mkEnableOption "extranix documentation";
- modules = mkOption {
- type =
- attrsOf (submodule {
- options = {
- specialArgs = mkOption {
- type = attrs;
- default = { };
- description = ''
- Special arguments to give to evalModules.
- '';
- };
- paths = mkOption {
- type = listOf deferredModule;
- description = ''
- Modules to from which to document options.
- '';
- };
- ignored-modules = mkOption {
- type = listOf deferredModule;
- default = [ ];
- description = ''
- Modules required to make modules of `paths` valid.
- '';
- example = ''
- import "''${infra-modulesPath}/module-list.nix"
- '';
- };
- path-translations = mkOption {
- type = listOf (submodule {
- options = {
- base = mkOption {
- type = path;
- description = ''
- Base path of some module files to be documented.
- '';
- };
- url = mkOption {
- type = str;
- description = ''
- Url root to use for files on this path.
- '';
- };
- };
- });
- description = ''
- Rules to convert file paths to urls in the documentation to indicate where
- the option is declared.
- '';
- };
+ modules = mkOption {
+ type = attrsOf (submodule {
+ options = {
+ specialArgs = mkOption {
+ type = attrs;
+ default = { };
+ description = ''
+ Special arguments to give to evalModules.
+ '';
};
- });
+
+ paths = mkOption {
+ type = listOf deferredModule;
+ description = ''
+ Modules to from which to document options.
+ '';
+ };
+
+ ignored-modules = mkOption {
+ type = listOf deferredModule;
+ default = [ ];
+ description = ''
+ Modules required to make modules of `paths` valid.
+ '';
+ example = ''
+ import "''${infra-modulesPath}/module-list.nix"
+ '';
+ };
+
+ path-translations = mkOption {
+ type = listOf (submodule {
+ options = {
+ base = mkOption {
+ type = path;
+ description = ''
+ Base path of some module files to be documented.
+ '';
+ apply = v: "${removeSuffix "/" (builtins.toString v)}/";
+ };
+ url = mkOption {
+ type = str;
+ description = ''
+ Url root to use for files on this path.
+ '';
+ apply = removeSuffix "/";
+ };
+ };
+ });
+ description = ''
+ Rules to convert file paths to urls in the documentation to indicate where
+ the option is declared.
+ '';
+ };
+ };
+ });
description = ''
Sets of modules to be documented separately. The identifier to give for
`settings.params.release_current_stable` (which is the default module shown) is the key after
passing through `sanitizeDerivationName`.
'';
};
- settings = mkOption {
- inherit (yaml) type;
+
+ host = mkOption {
+ type = str;
description = ''
- Settings for the `config.yaml` for the hugo instantiation.
+ Hostname of the service.
+ '';
+ };
+
+ index = mkOption {
+ type = str;
+ default = head (attrNames cfg.modules);
+ defaultText = literalExpression "head (attrNames config.services.extranix.modules)";
+ description = ''
+ The main module to show when loading the website.
+ '';
+ apply = sanitizeDerivationName;
+ };
+
+ static = mkOption {
+ type = nullOr path;
+ default = null;
+ description = ''
+ Path to extra static files.
+ '';
+ };
+
+ settings = mkOption {
+ inherit (pkgs.formats.json { }) type;
+
+ description = ''
+ Settings of the hugo website.
'';
example = {
baseUrl = "https://example.org/";
@@ -226,36 +331,28 @@ in
};
};
};
- static-data = mkOption {
- type = path;
- description = ''
- Static files for the website. Should have `images/favicon.png` for favicon.
- '';
- };
- host = mkOption {
- type = str;
- description = ''
- Hostname of the service.
- '';
- };
};
+
config = mkIf cfg.enable {
services = {
extranix.settings = {
- theme = "extranix-options-search";
+ theme = "options-search";
params = {
releases = mapAttrsToList (name: _: {
inherit name;
value = sanitizeDerivationName name;
}) cfg.modules;
- release_current_stable = mkDefault (head (attrNames options-files));
+
+ release_current_stable = cfg.index;
};
};
+
nginx = {
enable = true;
- virtualHosts.${cfg.host}.locations."/".alias = "${webroot}/";
+ virtualHosts.${cfg.host}.locations."/".root = website;
};
};
+
assertions = [
{
assertion = cfg.modules != { };
@@ -263,14 +360,6 @@ in
`services.extranix` can't be enabled without any modules to document.
'';
}
- {
- assertion = options-files ? ${cfg.settings.params.release_current_stable};
- message = ''
- `services.extranix.settings.params.release_current_stable` should be the
- `sanitizeDerivationName` of a key of `services.extranix.modules`, here one of:
- + ${concatStringsSep "\n + " (attrNames options-files)}
- '';
- }
];
};
}
diff --git a/modules/nixos/extranix/hugo-theme-extranix-options-search.nix b/modules/nixos/extranix/hugo-theme-extranix-options-search.nix
deleted file mode 100644
index 57b3fd7..0000000
--- a/modules/nixos/extranix/hugo-theme-extranix-options-search.nix
+++ /dev/null
@@ -1,75 +0,0 @@
-# SPDX-FileCopyrightText: 2024 Lubin Bailly
-#
-# SPDX-License-Identifier: EUPL-1.2
-
-{
- fetchFromGitHub,
- stdenv,
- lib,
- fetchurl,
-}:
-stdenv.mkDerivation {
- name = "hugo-theme-extranix-options-search";
-
- src = fetchFromGitHub {
- owner = "mipmip";
- repo = "hugo-theme-extranix-options-search";
- rev = "3252b5bd98adcbbe629327d72c8416c25014a0d6";
- hash = "sha256-XV7Js1KaBiWv9qao8iyzQ546nT1KkwCtvyAs++oeXFo=";
- };
-
- patches = [
- ./0001-revert-don-t-parse-md-in-js.patch
- ./0002-chore-remove-useless-dependencies.patch
- ./0003-feat-separate-HTML-description-of-MD-description.patch
- ./0004-fix-indentation-of-ul.patch
- ./0005-feat-match-all-substring-by-default.patch
- ];
-
- installPhase =
- let
- js-search = fetchurl {
- url = "https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js";
- hash = "sha256-LD9UsSATk+xTzAbk8nD2gA2bjHKvetXtCMDAFkM2K5Q=";
- };
- jquery = fetchurl {
- url = "https://code.jquery.com/jquery-3.7.1.slim.min.js";
- hash = "sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=";
- };
- bootstrap.css.main = fetchurl {
- url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css";
- hash = "sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=";
- };
- bootstrap.css.theme = fetchurl {
- url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css";
- hash = "sha256-ZT4HPpdCOt2lvDkXokHuhJfdOKSPFLzeAJik5U/Q+l4=";
- };
- bootstrap.js = fetchurl {
- url = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js";
- hash = "sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=";
- };
- in
- ''
- mkdir $out
- rm static/images/favicon.*
- cp -r * $out
- cp ${js-search} $out/static/js/js-search.min.js
- cp ${jquery} $out/static/js/jquery.slim.min.js
- cp ${bootstrap.css.main} $out/static/css/bootstrap.min.css
- cp ${bootstrap.css.theme} $out/static/css/bootstrap-theme.min.css
- cp ${bootstrap.js} $out/static/js/bootstrap.min.js
- substituteInPlace $out/layouts/index.html \
- --replace-fail 'https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js' js/js-search.min.js \
- --replace-fail 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js' js/jquery.slim.min.js \
- --replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' css/bootstrap.min.css \
- --replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css' css/bootstrap-theme.min.css \
- --replace-fail 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' js/bootstrap.min.js \
- '';
-
- meta = {
- description = "Theme which implements a nix modules options search machine.";
- homepage = "https://github.com/mipmip/hugo-theme-extranix-options-search";
- license = lib.licenses.asl20;
- maintainers = [ ];
- };
-}
diff --git a/modules/nixos/extranix/webroot.nix b/modules/nixos/extranix/webroot.nix
deleted file mode 100644
index aff5c49..0000000
--- a/modules/nixos/extranix/webroot.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-# SPDX-FileCopyrightText: 2024 Lubin Bailly
-#
-# SPDX-License-Identifier: EUPL-1.2
-
-{
- hugo,
- hugo-theme-extranix-options-search,
- options-files,
- settings,
- static-data,
- lib,
- runCommand,
-}:
-runCommand "nix-doc-webroot" { } ''
- mkdir themes
- ln -s ${hugo-theme-extranix-options-search} themes/extranix-options-search
- cp -rs ${static-data} static
- chmod -R u+w static
- mkdir static/data
- ${lib.concatStringsSep "\n" (
- lib.mapAttrsToList (name: file: "ln -s ${file} static/data/options-${name}.json") options-files
- )}
- ln -s ${settings} config.yaml
- ${lib.getExe hugo} --noBuildLock -d $out
-''