further catogorize profile/web, add python-docs
This commit is contained in:
24
profiles/web/docs/python-docs/default.nix
Normal file
24
profiles/web/docs/python-docs/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, pkgs, lib, mkDomain, ... }:
|
||||
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";
|
||||
};
|
||||
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));
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user