merge docs, add yagcd

This commit is contained in:
2023-02-26 03:53:55 +01:00
parent 181edd92e5
commit b1d987763c
8 changed files with 101 additions and 21 deletions

View File

@@ -1,24 +1,12 @@
{ config, pkgs, lib, mkDomain, ... }:
{ config, pkgs, lib, ... }:
let
python-versions = (lib.attrNames pkgs.pythonDocs.html);
mkLinkFarmEntry = python-version: {
name = python-version;
path = "${builtins.toString pkgs.pythonDocs.html.${python-version}}/share/doc/${python-version}/html";
python-versions = lib.attrNames (lib.filterAttrs (k: v: lib.isDerivation v) pkgs.pythonDocs.html);
mkDocsEntry = python-version: {
subdir = "${python-version}";
path = "${builtins.toString pkgs.pythonDocs.html.${python-version}}/share/doc/${python-version}/html";
desc = "Documentation for Python ${pkgs.${python-version}.version}";
};
in
{
services.nginx.virtualHosts.${mkDomain "python-docs"} = {
forceSSL = true; # addSSL = true;
enableACME = true; #useACMEHost = acmeDomain;
root = pkgs.linkFarm "python-docs" ([
{ name = "index.html"; path = pkgs.writeText "my-file" ''
<!DOCTYPE html>
<ul>
${lib.concatStringsSep "\n" (
builtins.map (name: ''<li><a href="${name}/">${name}/</a>'') python-versions
)}
</ul>
''; }
] ++ (builtins.map mkLinkFarmEntry python-versions));
};
services.docs-to-host.docs = builtins.map mkDocsEntry python-versions;
}