more doc-work

This commit is contained in:
2023-02-26 06:11:55 +01:00
parent b1d987763c
commit 91dc6fa2a5
10 changed files with 63 additions and 24 deletions

View File

@@ -5,10 +5,16 @@
services.docs-to-host.docs = mkOption {
type = types.listOf (types.submodule {
options = {
subdir = mkOption {
dirname = mkOption {
type = types.str;
example = "pdoc";
description = lib.mdDoc "The path at which the documentation will be linked";
example = "linux-doc";
description = lib.mdDoc "The relative dirname at which the documentation will be linked";
};
basename = mkOption {
type = types.str;
example = "foobar.html";
default = "";
description = lib.mdDoc "The basename at which the documentation will be linked";
};
path = mkOption {
type = types.path;
@@ -29,8 +35,8 @@
config = let
cfg = config.services.docs-to-host;
mkRow = {subdir, path, desc}: ''<tr><td><a href="${subdir}/">${subdir}/</a><td>${desc}'';
mkEntry = {subdir, path, desc}: { name = subdir; path = path; };
mkRow = {dirname, basename, path, desc}: ''<tr><td><a href="${dirname}/${basename}">${dirname}</a><td>${desc}'';
mkEntry = {dirname, basename, path, desc}: { name = dirname; path = path; };
in {
services.nginx.virtualHosts.${mkDomain "docs"} = {
forceSSL = true; # addSSL = true;